fail to pass variable on certain computers. :(

Discussion in 'PHP' started by yewtatt, Nov 26, 2007.

  1. #1
    I have a problem while trying to pass variable from page to page.
    And the problem only happen on certain computers, means that it works well on some computers but not for other computers...I am wondering what are the things that make the different. Can anyone help?

    I am having 2 pages, page1.php & page2.php.

    ---page1.php---
    session_start();
    $_SESSION['fullname'] = $fullname;


    ---page2.php---
    session_start();
    $name = $_SESSION['fullname'];

    I am beginner in php, the above codes i used works on certain computer where I able to pass the value of $fullname from page 1 to page 2 successfully, but I not sure is the method used correctly? If it is then what else of configuration that can make it only run on certain computer but not the others?
    For the computer where it does not work, I echo and found that the variable does not content data. guess the value is not able to go thru at all...:(

    Hope able to get some guidance here. Thanks in advance.

    regards,
    yewtatt
     
    yewtatt, Nov 26, 2007 IP
  2. nico_swd

    nico_swd Prominent Member

    Messages:
    4,153
    Likes Received:
    344
    Best Answers:
    18
    Trophy Points:
    375
    #2
    It's because you're relying on Register_globals.

    Use $_POST/$_GET/$_REQUEST/$_COOKIE variables. (The link above explains more)
     
    nico_swd, Nov 26, 2007 IP