PHP Help

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • malakajoe
    Confirmed User
    • Feb 2003
    • 1751

    #1

    PHP Help

    I was hoping someone with PHP knowledge can help me here. Just learning, so probably a stupid question.

    I am trying to set a global session variable from a sql select statement. But I am not getting anything passed.

    Here is a snip of the code.

    PHP Code:
    $sql = mysql_query("SELECT * FROM users WHERE email_address='$username' AND password='$password'");
    
    while($row = mysql_fetch_array($sql)){
        $firstname=$row["firstname"];
        $lastname=$row["lastname"]; 
        $id=$row["ID"]; 
        $code1=$row["code1"]; 
        $code2=$row["code2"];
        $code3=$row["code3"];
        $email_address=$row["email_address"]; 
        } 
    
            // Register session variables
    session_register('first_name'); 
            $_SESSION['first_name'] = $firstname; 
    session_register('last_name'); 
            $_SESSION['last_name'] = $lastname; 
    session_register('email_address'); 
            $_SESSION['email_address'] = $email_address;
    session_register('username'); 
            $_SESSION['username'] = $email_address;
    session_register('code1'); 
            $_SESSION['code1'] = $code1;
    session_register('code2'); 
            $_SESSION['code2'] = $code2;
    session_register('code3'); 
            $_SESSION['code3'] = $code3;
    session_register('id'); 
            $_SESSION['id'] = $id; 
    
    ICQ me please if you can help or answer here.

    ICQ #274397996

    Thanks.
    Selfpleasure.com for sale on auction. Closes on Tuesday March 11th at 9pm PST!!!!

    Dirty enough to be good, but clean enough for everyone!
    ------------------------------------------------------------------

    Moral Police - First graduating class coming soon! - Forcing our values across the internet
  • RK
    Confirmed User
    • Aug 2001
    • 868

    #2
    Do you have globals enabled?
    Does anyone look down here?

    Comment

    • delgato
      Registered User
      • Mar 2004
      • 25

      #3
      php.net has good hahahahahahahahaation so RTFM =]

      Look into the session handling functions.
      <img src="http://mkugroup.ath.cx/krank.jpg">

      Comment

      • malakajoe
        Confirmed User
        • Feb 2003
        • 1751

        #4
        Thanks for everyones help.

        I wasn't creating the session variables correctly at the beginning.

        Also, was getting a PHP message on the bottom of every page about a warning with calling session variables.

        But it is all working now.

        Selfpleasure.com for sale on auction. Closes on Tuesday March 11th at 9pm PST!!!!

        Dirty enough to be good, but clean enough for everyone!
        ------------------------------------------------------------------

        Moral Police - First graduating class coming soon! - Forcing our values across the internet

        Comment

        Working...