What Paul suggested helped because I was able to pin point the real issue.
Now I get three errors:
Warning: main(is_loginphp): failed to open stream: No such file or directory in /home/dir/public_html/editalbum/edit/index.php on line 10
Warning: main(): Failed opening ‘is_loginphp’ for inclusion (include_path=’.:/usr/lib/php:/usr/local/lib/php’) in /home/dir/public_html/editalbum/edit/index.php on line 10
Fatal error: Call to undefined function: is_login() in /home/dir/public_html/editalbum/edit/index.php on line 11
The problem is when I add mysql_error() again these errors are removed and a random on is added. So I add mysql_error() to that one (without removing anything) and that new error moves (not always down the file either (ie line 7, 20, 14…).
This new error will be something like:
Warning: Cannot modify header information - headers already sent by (output started at /home/ldir/public_html/editalbum/script/login.php:10) in /home/dir/public_html/editalbum/script/login.php on line 14
Thank you for the help
Here is more code to help
<?php
$db = mysql_connect("host", "user", "pass") or die("Cannot connect to db");
mysql_select_db("user_photoalbum", $db) or die("Db not selected");
$result = mysql_query("SELECT * from album_users", $db);
$num_rows = mysql_num_rows($result);
for ($i = 0; $i < $num_rows; $i++) {
$row = mysql_fetch_array($result);
echo "
MYSQL ERROR".mysql_error()."
";
if (stripslashes($row["user_name"]) == $user_name && stripslashes($row["password"]) == $password) {
echo "
MYSQL ERROR".mysql_error()."
";
$result = mysql_query("UPDATE album_users SET is_logged_in = 'Y' WHERE user_name = $user_name && password = $password");
Header('Location: ../edit/index.php?user_name=$user_name');
$i = $num_rows;
}
else {
// go to index with error message user/pass no work
$i = mysql_fetch_array($result);
Header('Location: ../index.php?error=true');
}
}
?>
Thanks again