hello friends,
Help me plz.any body can tell me how to pass a value from one page to another page by using a session. After login page.

Help me plz


<form name="join" action="check_login.php" method="post" onsubmit="return validate_form(join)">
<table border="0px">
<tr><td align="left">E-mail: </td><td><input type="text" name="email" value="" class="form_field" /></td></tr>
<tr><td align="left">Password: </td><td><input type="password" name="password" value="" class="form_field" /></td></tr>
<tr><td></td><td align="right"><span style="width:150px; float:left; font-family:'Times New Roman', Times, serif; color:#CC0000"><a href="join.php">Not a member yet? <em>Register Now</em></a></span><input type="submit" name="submit" value="Login" /></td></tr>
</table><br />



<?php session_start()?>

$con=mysql_connect($host,$user,$pass) or die(mysql_error());


$select="SELECT * FROM users WHERE email='$email' and password='$password'";
if(mysql_num_rows($result) > 0)




Read the tutorials as rajarajan07 suggested, but for a quick answer to your question, if you just add


to the top of home.php, you should be able to use the variable $_SESSIOIN. Remember to sanitize the $_POST data before you use it though.


Note* You should have the session_start() code at the top of every page you intent to use session data with.

i think this code help you
First send the variable to a script
<form method="post" action="array_script.php">
<input type="text" name="first_name"/><br/><br/>

<input type="submit" name="submit"/> </form>
Move $_POST variable contents into $_SESSION
I will always need to call "session_start()" to use $_SESSION

<?php session_start();



Above I called the the session_start() function, created a session variable, and set that variable the values sent over via POST. Now I can access that $_SESSION variable from any page on my server.
Accessing $_SESSION Variable
I will always need to call "session_start()" to use $_SESSION

<?php session_start();

$first_name = $_SESSION

echo $first_name;