nex1234 Posted July 7, 2008 Share Posted July 7, 2008 My background image won't load until i refresh the page. This happens in Firefox and Internet Explorer. Heres the code: <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> <html xmlns="http://www.w3.org/1999/xhtml"> <head> <meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" /> <title>MPS Project Tracking</title> </head> <body background="ripple.jpg"> <?php mysql_connect('localhost', '----', '----') or die(mysql_error()); mysql_select_db('mps') or die(mysql_error()); if (isset($_POST['login'])) { if (!$_POST['username'] | !$_POST['password']) { print('You must complete all input fields.'); } $check_one = mysql_query("SELECT * FROM mps_login WHERE username = '".$_POST['username']."'") or die(mysql_error()); $check_two = mysql_num_rows($check_one); if ($check_two == 0) { print('The username "'.$_POST['username'].'" does not exist.'); } while ($check_three = mysql_fetch_array($check_one)) { $_POST['password'] = stripslashes($_POST['password']); $check_three['password'] = stripslashes($check_three['password']); $_POST['password'] = md5($_POST['password']); if ($_POST['password'] != $check_three['password']) { print('The password you entered is not valid.'); } else { setcookie('username', $_POST['username'], time()+3600); setcookie('password', $_POST['password'], time()+3600); header('Location: home.php'); } } } ?> <body> <b><u>MPS PROJECT TRACKING</u></b><br /><br /> <form action="<?php echo $_SERVER['PHP_SELF']; ?>" method="post"> <table> <tr> <td>Login:</td> </tr> <tr> <td>Username:</td> <td><input type="text" name="username" /></td> </tr> <tr> <td>Password:</td> <td><input type="password" name="password" /></td> </tr> <tr> <td><input type="submit" name="login" value="Login" /></td> </tr> </table> </form> </body> </html> Quote Link to comment Share on other sites More sharing options...
nex1234 Posted July 7, 2008 Author Share Posted July 7, 2008 Also, I just noticed if I change the location of the background tag it seems to load fine. Could this be the cause? Heres the updated code. <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> <html xmlns="http://www.w3.org/1999/xhtml"> <head> <meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" /> <title>MPS Project Tracking</title> </head> <?php mysql_connect('localhost', '----', '----') or die(mysql_error()); mysql_select_db('mps') or die(mysql_error()); if (isset($_POST['login'])) { if (!$_POST['username'] | !$_POST['password']) { print('You must complete all input fields.'); } $check_one = mysql_query("SELECT * FROM mps_login WHERE username = '".$_POST['username']."'") or die(mysql_error()); $check_two = mysql_num_rows($check_one); if ($check_two == 0) { print('The username "'.$_POST['username'].'" does not exist.'); } while ($check_three = mysql_fetch_array($check_one)) { $_POST['password'] = stripslashes($_POST['password']); $check_three['password'] = stripslashes($check_three['password']); $_POST['password'] = md5($_POST['password']); if ($_POST['password'] != $check_three['password']) { print('The password you entered is not valid.'); } else { setcookie('username', $_POST['username'], time()+3600); setcookie('password', $_POST['password'], time()+3600); header('Location: home.php'); } } } ?> <body background="ripple.jpg">> <b><u>MPS PROJECT TRACKING</u></b><br /><br /> <form action="<?php echo $_SERVER['PHP_SELF']; ?>" method="post"> <table> <tr> <td>Login:</td> </tr> <tr> <td>Username:</td> <td><input type="text" name="username" /></td> </tr> <tr> <td>Password:</td> <td><input type="password" name="password" /></td> </tr> <tr> <td><input type="submit" name="login" value="Login" /></td> </tr> </table> </form> </body> </html> Quote Link to comment Share on other sites More sharing options...
haku Posted July 8, 2008 Share Posted July 8, 2008 First - you have to give us the output of the php code, not the php code. No one is going to go through your php to figure out what the output is. Second - you would be better off giving us a link (google free hosting if you don't have a server) so we can see it live. If you do nothing, you almost definitely won't get an answer to your problem. If you do the first thing, you may get an answer to your problem. If you do the second thing, you will probably get an answer to your problem. Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.