RE: [PHP] Session confusion again :( - Thanks!
| From: | Chris W. Parker | Date: | Wed, 14 Apr 2004 19:31:07 +0000 |
| Subject: | RE: [PHP] Session confusion again :( - Thanks! | ||
| Groups: | php.general | ||
| Request: | Send a blank email to php-general+get-183370@lists.php.net to get a copy of this message | ||
BOOT <mailto:pfine@of-law.com>
on Wednesday, April 14, 2004 12:17 PM said:
> So I went and turned them off. Now of course my pages don't work
> properly. I guess I have to go through all my code and address the
> variables properly ie. $_POST and $_SESSION?
no.
just assign them at the beginning of your file.
CURRENT FILE:
<?php
echo "$username is logged in!!";
echo "hello $username, you are logged in.";
?>
WHAT I THINK YOU WOULD CHANGE IT TO:
<?php
echo "{$_GET['username']} is logged in!!";
echo "hello {$_GET['username']}, you are logged in.";
?>
WHAT YOU SHOULD DO INSTEAD:
<?php
$username = $_GET['username'];
echo "$username is logged in!!";
echo "hello $username, you are logged in.";
?>
of course. don't forget to validate your incoming data.
hth,
chris.