Re: Re: Sessions
| From: | Justin French | Date: | Sun, 06 Oct 2002 02:17:42 +0000 |
| Subject: | Re: Re: Sessions | ||
| References: | 1 | Groups: | php.general |
| Request: | Send a blank email to php-general+get-118979@lists.php.net to get a copy of this message | ||
To clarify, and correct a few typos:
Instead of:
$ssun = "foo";
session_register("ssun");
Try:
$_SESSION['ssun'] = "foo";
HTH
Justin
on 06/10/02 12:11 PM, Jeff Bluemel (jeff@domintcom.com) wrote:
> instead of using the session_register try $_SESSTION[' ssun']
>
>
> "Steve Vernon" <steve@extremewattage.co.uk> wrote in message
> 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="";
>> }
>> }
>>
>
>