Re: Sending a message

From: Date: Sat, 06 Aug 2011 05:24:51 +0000
Subject: Re: Sending a message
Groups: php.general 
Request: Send a blank email to php-general+get-314373@lists.php.net to get a copy of this message
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'; } ?> On Aug 04, 2011, at 10:23 PM, Negin Nickparsa <nickparsa@gmail.com> 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?


« previous php.general (#314373) next »