i am trying to create and name sessions from post variables and i am not quite sure how to do it. here is what i have so far:
session_start();
$_SESSION['{$_POST['name']}'];
$_SESSION['{$_POST['email']}'];
i know this is completly wrong, and I was wondering if someone could help me do it right
thanks
name sessions from post variables
Moderator: General Moderators
- John Cartwright
- Site Admin
- Posts: 11470
- Joined: Tue Dec 23, 2003 2:10 am
- Location: Toronto
- Contact:
Phenom is most correct.
any page you wish to access session variables must have a session_start();
But - I would assign it to a variable, ie:
$user = $_SESSION['username'];
echo $user;
Makes it so you dont have to keep typing $_SESSION cause if your like me, i always forget to make the underline and $SESSION, oh well! lol

any page you wish to access session variables must have a session_start();
But - I would assign it to a variable, ie:
$user = $_SESSION['username'];
echo $user;
Makes it so you dont have to keep typing $_SESSION cause if your like me, i always forget to make the underline and $SESSION, oh well! lol