SitePoint Sponsor

User Tag List

Results 1 to 4 of 4
  1. #1
    SitePoint Member
    Join Date
    Nov 2004
    Location
    Philippines
    Posts
    10
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Fatal error: Cannot create references to/from string offsets

    hello there, im beginner in php programming.

    when i run this script the error appear is "Fatal error: Cannot create references to/from string offsets nor overloaded objects in core24.php on line 296.


    what is the possible solution for this script?


    function save_orderinfo(&$frm) {
    global $USER;

    $order = new Object();
    $order->customer = $frm["customer"];
    $order->email = $frm["email"]; //MADE ADDITIONAL BY JDJ
    $order->contact = $frm["contact"];
    $order->cellno = $frm["cellno"];
    $order->address = $frm["address"];
    $order->city = $frm["city"];
    $USER["orderinfo"] = &$order;
    }

  2. #2
    SitePoint Zealot Caged's Avatar
    Join Date
    May 2003
    Location
    United States
    Posts
    107
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Try this:
    $USER["orderinfo"] = $order;

  3. #3
    Resident Java Hater
    Join Date
    Jul 2004
    Location
    Gerodieville Central, UK
    Posts
    446
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Quote Originally Posted by Caged
    Try this:
    $USER["orderinfo"] = $order;
    That would copy the user class, and therefore you would run into a number of issues, espcially if your two objects where being updated and then persisteted to the database you run into issues.

    To me it seems like the issue is because you are running an old version of PHP (i.e. < v4.1). I had this on older versions of PHP. Maybe it would be an idea to confirm this by searching the PHP bug DB for this on older versions of PHP.

    if you have PHP installed on Linux, the best way to upgrade is to call phpinfo() before you build a new version. From the result of that, copy the ./configure params and use that to build the new version.

    It's a good idea to stop httpd when you do the make install bit.... and then start it after. If it doesn't update, do a locate libphp4.so and make sure the newly compiled module is copied over to the location of the active libphp4.so file (or you can tell it in the compile phase where the location of the current libphp4.so file is so it overwrites it)

  4. #4
    SitePoint Member
    Join Date
    Nov 2004
    Location
    Philippines
    Posts
    10
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Thanks MiiJaySung and caged, i update the version of PHP and finally it's run perfectly....


Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •