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
login.php
<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>
<td> </td>
<tr><td align="left">Password: </td><td><input type="password" name="password" value="" class="form_field" /></td></tr>
<td> </td>
<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 />
</form>
check_login.php
<?php session_start()?>
<?php
$host="localhost";
$user="root";
$pass="";
$db_name="oma";
$con=mysql_connect($host,$user,$pass) or die(mysql_error());
$sql=mysql_select_db($db_name,$con);
$email=$_POST;
$password=$_POST;
$select="SELECT * FROM users WHERE email='$email' and password='$password'";
$result=mysql_query($select);
if(mysql_num_rows($result) > 0)
{
$_SESSION=$email;
header("location:home.php");
}
else{
header("location:login_wrong.php");
}
?>