RE: [PHP-WIN] Redirection Question.

From: Date: Fri, 18 Jan 2002 21:19:03 +0000
Subject: RE: [PHP-WIN] Redirection Question.
Groups: php.windows 
Request: Send a blank email to php-windows+get-11517@lists.php.net to get a copy of this message
Curtis, the call to session_register needs a string that names the variable: Instead of: session_register($username); You need: session_register('username'); This would register the $username variable.... Court -----Original Message----- From: Curtis [mailto:Curtis@scdservices.zzn.com] Sent: Friday, January 18, 2002 12:08 PM To: php-windows@lists.php.net Subject: [PHP-WIN] Redirection Question. I've got everything working except for one piece. I'm trying to authenticat users against a mySQL database and then once they are authenticated I'm trying to create a session that's the same as their username. Once the session is established I want to redirect them to another page that requires the session to be established. However I get everything except for the redirection to work. At this point I have already authenticated them by finding a row in the database with the username and password they entered through a form. Now I want to establish a session with their authenticated username. Here is where the code is failing. if ($myrow = mysql_fetch_array($result)) { //if there is a row in the database then the user //must have submitted the username and matching password session_start(); session_register($username); header ("Location: ./myinfo.php"); //THIS IS NOT WORKING!!!!! //exit; /* I tried with and without the exit. If I do without the exit nothing happens and the below is not shown on the screen. When I try it with the exit the below is shown and I'm still not redirected. */ //echo "<b><i>We have located you in the database!</b><p>"; } else {echo "<b><i>No Records Found!</b><p>";} //Show login again Any tips, ideas, or suggestions would be greatly appreciated. Thanks, Curt www.killerpigs.com www.scdservices.com www.angryland.com Get your Free E-mail at http://scdservices.com ____________________________________________________________ Get your own FREE Web and POP E-mail Service in 14 languages at http://www.zzn.com. -- PHP Windows Mailing List (http://www.php.net/) To unsubscribe, e-mail: php-windows-unsubscribe@lists.php.net For additional commands, e-mail: php-windows-help@lists.php.net To contact the list administrators, e-mail: php-list-admin@lists.php.net

« previous php.windows (#11517) next »