Re: Variable Value 2 Session Name
| From: | Silver | Date: | Tue, 05 Nov 2002 11:37:05 +0000 |
| Subject: | Re: Variable Value 2 Session Name | ||
| References: | 1 | Groups: | php.general |
| Request: | Send a blank email to php-general+get-122757@lists.php.net to get a copy of this message | ||
well - as far as I understand - this line...
> $SessionUser = $row['.$IDFeild.'];
...should read:
$SessionUser = $row[$IDField];
so - in my eyes just a syntax error. I hope I'm right....
in case you have session_autostart disabled in yout php.ini you first have
to start
the session with the session_start() command.
_andi
"Stephen Of Blank Canvas Group" <stephen@blankcanvasgroup.info> schrieb im
Newsbeitrag news:003401c284bc$c4a76ce0$0101a8c0@abstractinternet.net...
> I'm trying to create what I believe should be a simple script to help
> with logging users into my site. My problem is that at the top of my
> script I set a variable with it's value and then at later script I
> cannot appear to access it.
>
> Extract of my code is as follows and fails:
>
> $IDField = "loginemail";
> $SessionUser = $row['.$IDFeild.'];
> session_register('SessionUser');
>
> However if I change the second line to
>
> $SessionUser = $row['loginemail'];
>
> It works great.
>
> Any help would be really appreciated as I think it's just me missing
> some basics.
>
> Thanks
>
> Stephen
>