<?php
session_start();
$username= $_POST['logname'];
$_SESSION['name'] = $username;
$userpswd= $_POST['logpswd'];
$_SESSION['pswd'] = $userpswd;
?>
When I goto the next page theres nothing in these varables, is there something I need to do to register these that I am not doing?
Thanks in advance
Problem with Session Varables
Moderator: General Moderators
-
penguinboy
- Forum Contributor
- Posts: 171
- Joined: Thu Nov 07, 2002 11:25 am
The solution... maybe.. :)
I had the same problem, check your php.ini and locate this:
session.use_trans_sid = 0
and change the 0 to 1:
session.use_trans_sid = 1
Then reboot your puter.
And then your script will work, promise.
And 4 some code, have a look at my little test.
First page
Second page
session.use_trans_sid = 0
and change the 0 to 1:
session.use_trans_sid = 1
Then reboot your puter.
And then your script will work, promise.
And 4 some code, have a look at my little test.
First page
Code: Select all
<?php
session_start();
$un = "anders";
$_SESSION['uname']=$un;
$_SESSION['ualias']='olle';
echo '<pre>';
print_r($_SESSION);
echo '</pre>';
?>
<p><a href="test4.php">Page 2</a></p>Second page
Code: Select all
<?php
session_start();
echo '<pre>';
print_r($_SESSION);
echo '</pre>';
echo $_SESSION['uname'];
echo $_SESSION['ualias'];
?>- twigletmac
- Her Royal Site Adminness
- Posts: 5371
- Joined: Tue Apr 23, 2002 2:21 am
- Location: Essex, UK