Thread: %?$*#! session

    #1
  1. No Profile Picture
    Contributing User
    Devshed Newbie (0 - 499 posts)

    Join Date
    Sep 2000
    Location
    france
    Posts
    35
    Rep Power
    15
    can anyone tell me why this f***ing piece of code doesn't work:

    It is located in an authentication (login/password) action page.

    <?php
    include("../header.php");

    $query = mysql_query(...);
    $reguserid = mysql_result(..);
    $reguserip = $REMOTE_ADDR;
    $usersurname = mysql_result(...);
    $username = mysql_result(...);

    session_register("reguserid");
    session_register("reguserip");
    session_register("usersurname");
    session_register("username");

    header("Location: nextpage.php?".sid);
    ?>

    header.php contains a session_start() and doesn't print anything.
    The program goes to the next page but session variables are absent...

    Thanx to anyone who'll help me out

    -
    J0f
  2. #2
  3. .Net Developer
    Devshed Novice (500 - 999 posts)

    Join Date
    Feb 2000
    Location
    London
    Posts
    987
    Rep Power
    15
    Just try to use session_start() in the current page insted of including that in the
    page.

    <?php
    include("../header.php");
    session_start();
    $query = mysql_query(...);
    $reguserid = mysql_result(..);
    $reguserip = $REMOTE_ADDR;
    $usersurname = mysql_result(...);
    $username = mysql_result(...);
    session_register("reguserid");
    session_register("reguserip");
    session_register("usersurname");
    session_register("username");
    header("Location: nextpage.php?".sid);
    ?>

    next page try to print and see wether the session has been created or not.

    <?php
    session_start();
    echo "session variable".$reguserid;
    ?>

    which version of php you are using?



    ------------------
    SR -
    webshiju.com
    www.jobxyz.com-IT Career Portal
    ezipindia.com--WebStudio


    "The fear of the LORD is the beginning of knowledge..."

Similar Threads

  1. refreshing page on session
    By xlordt in forum PHP Development
    Replies: 3
    Last Post: August 26th, 2003, 03:28 PM
  2. reading existing session, problem
    By buttie in forum Perl Programming
    Replies: 7
    Last Post: August 11th, 2003, 10:26 AM
  3. session start issue!
    By djl in forum PHP Development
    Replies: 0
    Last Post: July 29th, 2003, 01:37 PM
  4. PATH_INFO URL - Search Engine Friendly
    By Coopercentral2 in forum PHP Development
    Replies: 2
    Last Post: April 19th, 2003, 10:44 PM
  5. anonFTP hack?
    By (jp) in forum FTP Help
    Replies: 3
    Last Post: March 10th, 2003, 01:58 PM

IMN logo majestic logo threadwatch logo seochat tools logo