GoFuckYourself.com - Adult Webmaster Forum

GoFuckYourself.com - Adult Webmaster Forum (https://gfy.com/index.php)
-   Fucking Around & Business Discussion (https://gfy.com/forumdisplay.php?f=26)
-   -   PHP Help (https://gfy.com/showthread.php?t=267596)

malakajoe 04-10-2004 08:56 PM

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.

RK 04-10-2004 09:27 PM

Do you have globals enabled?

delgato 04-10-2004 09:42 PM

php.net has good hahahahahahahahaation so RTFM =]

Look into the session handling functions.

malakajoe 04-10-2004 09:47 PM

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.

:glugglug


All times are GMT -7. The time now is 07:44 PM.

Powered by vBulletin® Version 3.8.8
Copyright ©2000 - 2025, vBulletin Solutions, Inc.
©2000-, AI Media Network Inc123