This is the login.php which checks the form on the login page.
<?php
session_start();
include('connect.php');
$user=$_POST['user'];
$pass=$_POST['pass'];
$sql="SELECT * FROM members WHERE username='$_POST[user]' and password='$_POST[pass]'";
$result=mysql_query($sql, $con);
$count=mysql_num_rows($result);
if ($count==1){
session_start();
$_SESSION['user'] = $user;
}
else{
echo 'Wrong Username or Password';
}
?>
session_start();
include('connect.php');
$user=$_POST['user'];
$pass=$_POST['pass'];
$sql="SELECT * FROM members WHERE username='$_POST[user]' and password='$_POST[pass]'";
$result=mysql_query($sql, $con);
$count=mysql_num_rows($result);
if ($count==1){
session_start();
$_SESSION['user'] = $user;
}
else{
echo 'Wrong Username or Password';
}
?>
On Aug 04, 2011, at 10:23 PM, Negin Nickparsa <nickparsa@xxxxxxxxx> wrote:
you must check setting your session with this one:
if(isset($_SESSION['user']))
{
// Identifying the user
$user = $_SESSION['user'];
// Information for the user.
}
tell me what you have done in login page?