Re: Sessions
| From: | nicos@php.net | Date: | Sat, 05 Oct 2002 21:16:51 +0000 |
| Subject: | Re: Sessions | ||
| References: | 1 | Groups: | php.general |
| Request: | Send a blank email to php-general+get-118967@lists.php.net to get a copy of this message | ||
Do you use globals on or off ?
--
Nicos - CHAILLAN Nicolas
nicos@php.net
www.WorldAKT.com - Hébergement de sites Internet
"Steve Vernon" <steve@extremewattage.co.uk> a écrit dans le message de news:
056a01c26cb2$509f2260$a5e387d9@extreme...
> Hiya,
> Just upgraded to 4.2.3 and I am using the attatched PHP.ini file. I
use
> sessions on my website, and they dont seem to work now after the upgrade.
> Just wondering which lines do I need to alter please? After I logon, they
> loose the session after choosing another page. Every page runs the
following
> code to check the session passwords etc are valid..
>
> Thanks,
>
> Steve
> XX
>
>
>
> <?php
> session_register("ssun");
> session_register("sspw");
>
> if(!isset($ssun)) $ssun="";
> if(!isset($sspw)) $sspw="";
>
> //Attempt to logon. Set the logon form variables to the session
variables.
> if(isset($sspass))
> {
> $sspw=$sspass;
> }
>
> if(isset($ssname))
> {
> $ssun=$ssname;
> }
>
> //Make sure no one breaks in, if in the param loggedin was set, unset it.
> if(isset($loggedin))
> {
> unset($loggedin);
> }
>
> //Link and select the correct database
> HIDDEN FOR MY SECURITY!!!!
>
>
> //Check if the ssun and sspw are correct
> $result = mysql_query("SELECT userid FROM users WHERE
> userpassword=PASSWORD('$sspw') AND userid='$ssun'", $db_link);
> $norows = mysql_num_rows($result);
>
> if($norows==1)
> {
> $loggedin="yes";
> }
> else
> {
> $loggedin="no";
> }
>
> if(isset($logoff))
> {
> if($logoff=="true")
> {
> $loggedin="no";
> $ssun="";
> $sspw="";
> }
> }
>