this is my code:
<?php
function connect()
{
header("Cache-Control: no-cache, must-revalidate");
// if (!isset($_SESSION['uname']) || (!isset($_SESSION['pword'])))
// {
// header('location:http://localhost/ver/loginstrike.htm');
// }
define('T',TRUE);
define('F',FALSE);
$uname = $_POST['textfielda'];
$pword = $_POST['textfieldb'];
//echo $uname . '<br>';
//echo $pword . '<br>';
$link = mysql_connect('127.0.0.1:3306','root','');
mysql_error($link);
if ($link == T)
{
echo ' <p align = center> <font color = #FFFFFF size = 4> Connected </p>' ;
$db = mysql_select_db('account',$link) ;
$query = mysql_query("select * from login where '$uname' = UNAME and '$pword' = PWORD");
$records = mysql_fetch_row($query);
if ($records == T)
{
echo ' <p align = center> <font color = #00FF00> Welcome ' . $records[3] . ' ' . $records[4] . '</p>' ;
session_start() ;
$_SESSION['uname'] = $records[1];
$_SESSION['pword'] = $records[2];
$_SESSION['fname'] = $records[3];
$_SESSION['lname'] = $records[4];
$_SESSION['alias'] = $records[5];
$_SESSION['email'] = $records[6];
$_SESSION['exp_days'] = $records[7];
$_SESSION['dt_start'] = $records[8];
$_SESSION['stat_mail'] = $records[9];
$_SESSION['stat_exp'] = $records[10];
$_SESSION['counter'] = $records[11];
mysql_error($link) ;
mysql_close($link) ;
}
elseif ($records == F)
{
// header('location:http://localhost/ver/loginstrike.htm');
mysql_close($link) ;
echo '<a href="http://localhost/ver/loginstrike.htm">Back</a>' ;
die('<p align = center> <font color = #FF0000 size = 4> Improper Login </p>');
echo 'tulin';
}
}
}
?>
now the problem is everytime i am using header('location:http://localhost/loginstrike.htm') after logout the loginstrik.htm cannot execute the php scrip why?
help php page reload:
Moderator: General Moderators
- aceconcepts
- DevNet Resident
- Posts: 1424
- Joined: Mon Feb 06, 2006 11:26 am
- Location: London
Re: help php page reload:
Do you get an error displayed?
Maube your headers have already been sent!
Maube your headers have already been sent!