oh....one other thing
how is the session variable carried to another page and how do you print the session variable on another page?
like...lets say i wanted to store a username into a session
ok lets say you type in your username here and submit it...
(lets call this page submit.php)
now this is where it send the form data when u click submit...
(lets say the below code is in a file called login.php)
so i just threw that togethor right quick but anyway. as youc an see what im trying to do is store the username in a session thatway whenever a page requests the username what their entered before is in a session and it puts the value of the session variable in the value for the input box of the username input box..
sorry if this is confusing but thanks
how is the session variable carried to another page and how do you print the session variable on another page?
like...lets say i wanted to store a username into a session
ok lets say you type in your username here and submit it...
(lets call this page submit.php)
PHP Code:
<?php
session_start();
?>
<html>
<body>
<form method="post" action="login.php">
<input type="text" name="username">
<input type="submit" value="login">
</form>
<body>
</html>
(lets say the below code is in a file called login.php)
PHP Code:
<?php
session_start();
?>
<html>
<body>
<?php
$username = $username1."".$username."";
$_SESSION['sessionusername'] = $username;
print "<input type=\"text\" name=\"username\" value=\"$sessionusername\">";
?>
<body>
</html>
so i just threw that togethor right quick but anyway. as youc an see what im trying to do is store the username in a session thatway whenever a page requests the username what their entered before is in a session and it puts the value of the session variable in the value for the input box of the username input box..
sorry if this is confusing but thanks
Comment