[geeklog-users] Help!

Khalid Bentamy kbentamy at bigpond.com.au
Tue Mar 18 03:48:29 EST 2003


When running the php script below the browser is returning this error:

"Warning: Cannot modify header information - headers already sent by (output
started at c:\program files\apache group\apache\htdocs\update_login.php:2)
in c:\program files\apache group\apache\htdocs\update_login.php on line 25"

 I do not know what's wrong with my script....Help Please

Thanks
Ben

The Script:
=========================================================================
<HTML>
<?php


$db = mysql_connect("localhost","xxxx","xxxx","root") or
        die("Could not connect: " . mysql_error());

mysql_select_db("xxxxx",$db) or die( "Unable to select database");


$curusername=$_POST[current_user_name];
$curpswd=$_POST[current_password];
$newusername=$_POST[new_user_name];
$newpswd=$_POST[new_password];


$sql = "select username, password from projectowner where
username='$curusername'and  password='$curpswd'";

$result = mysql_query($sql,$db);
$num = mysql_num_rows($result);

if ($num != 0) {
	$sql = "update projectowner set username='$newusername',password
='$newpswd'where 		 username='$curusername'and password='$curpswd'";
        $result = mysql_query($sql,$db);
  	header("Location: http://www.xxx.xxx.xxx/");
} else {
echo "Sorry, Wrong Password or User Name!";
print "<br><br><a href=\"javascript:history.back(1)\">go back</a>";
}

?>
</HTML>

=========================================================================




More information about the geeklog-users mailing list