Re: Sending a message

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



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@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?

[Index of Archives]     [PHP Home]     [Apache Users]     [PHP on Windows]     [Kernel Newbies]     [PHP Install]     [PHP Classes]     [Pear]     [Postgresql]     [Postgresql PHP]     [PHP on Windows]     [PHP Database Programming]     [PHP SOAP]

  Powered by Linux