Still searching and reading on this but not finding the answer or at least one that explains it to me being wet behind the ears PHP programmer wanna be.
sry to add yet another post on this subject but I just do not know what it is looking for? I did do several things that other posts suggested but it still errors.
The error:
Warning: Cannot modify header information - headers already sent by (output started at E:\TestSite folder\TestSite\password.php:10) in E:\TestSite folder\TestSite\password.php on line 55
Here's my code:
<html>
<head>
<meta http-equiv="content-type" content="text/html;charset=iso-8859-1">
<meta name="generator" content="Adobe GoLive 6">
<title>Welcome to Adobe GoLive 6</title>
</head>
<body bgcolor="#ffffff">
<div align="center">
<?php
$pname='Bob';
if ($POST['txtUsername'] != $pname)
{
?>
<h1>Login</h1>
<form name="form" method="POST" action="<?php echo $SERVER['PHP_SELF']; ?>">
<p><label for="txtUsername">Username:</label>
<br /><input type="text" title="Enter your Username" name="txtUsername" value="<?php echo $pname ?>" /></p>
<p><label for="txtpassword">Password:</label>
<br /><input type="password" title="Enter your password" name="txtPassword" /></p>
<p><input type="submit" name="Submit" value="Login" /></p>
</form>
<?php
}
else {
?>
<?php
$upass=$txtPassword;
mysql_connect("localhost", "<id here>", "<pwhere>") or die("Failure to communicate with database");
mysql_select_db("<db here>");
$query = "SELECT name, city from testdb where aes_decrypt(<tbl field>,'<key>')='$upass'";
$result = mysql_query($query);
$parr=mysql_fetch_array($result);
$tempr=$parr['city'];
if(empty($tempr))
{
?>
<table>
<tr><td align="center"><font size="3"><b>You have entered an invalid password. Please try again.</b></font></td></tr>
<tr><td align="center"><font size="2"><b><a href="password.php" target="_self">RETRY</a></b></font></td></tr>
<tr><td align="center"><font size="3"><b> </b></font></td></tr>
<tr><td align="center"><font size="3"><b>Remember: UserID's and Passwords are case sensitive.</b></font></td></tr>
</table>
<?php
} else {
$gname=$parr['name'];
?>
<table>
<tr><td align="center"><font size="3"><b>Hello <?php echo $gname ?> from <?php echo $tempr ?></b></font></td></tr>
<tr><td align="center"><font size="2"><b>Insert all your code here</b></font></td></tr>
</table>
<?php
header("Location:NextPage.php");
?>
<?php
}
}
?>
<p></p>
</body>
</html>