note 57829 deleted from function.session-register by mazzanet
| From: | mazzanet@php.net | Date: | Sat, 15 Oct 2005 09:53:30 +0000 |
| Subject: | note 57829 deleted from function.session-register by mazzanet | ||
| References: | 1 | Groups: | php.notes |
| Request: | Send a blank email to php-notes+get-97066@lists.php.net to get a copy of this message | ||
Note Submitter:
----
//main.php
<?
session_start();
include("dbconnect.php");
if (isset($_POST['submitadmin']))
{
$username=$_POST['aduser'];
$pass=$_POST['adpass'];
$query="select * from admin where username= '$username' and passwrd=
'$pass' ";
$res=mysql_query($query) or die (mysql_error());
$num = mysql_fetch_row($res);
if ($num >= 1)
{
$_SESSION["namesess"]=$username;
header("Location: feedbacklists.php");
}
else
{
$msg="Invalid Username/Password";
}
}
?>
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
<head>
......
// main.php ends
//feedbacklists.php
<?
session_start();
include("dbconnect.php");
if (!isset($_SESSION["namesess"]))
{
header("Location: main.php");
}
?>
<html>
<head>
..........
after verifying my username and password the browser is redirected to feedbacklists.php. but it is
not happening as if the session is not set and the browser returning to
main.php. what could be wrong in my code.pls help.