KaineBennett Posted August 16, 2014 Share Posted August 16, 2014 Need help on this page, it just gives me an error and does not load after I log in. If anyone knows why then let me know. <?php /*------------includes--------------*/ session_start(); include ('./includes/connections.php'); /*------------includes--------------*/ mysql_query("DELETE FROM `fed_jailed` WHERE `fj_time` <= '".time()."'"); ?> <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> <link type="text/css" rel="stylesheet" href="css/style.css" /> <html xmlns="http://www.w3.org/1999/xhtml"> <head> <link REL="SHORTCUT ICON" HREF="images/ico-icon.jpg"> <meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" /> <title>ERROR</title> </head> <body> <div id = 'BGimg'><img src = 'images/ingame-bg.jpg' width = '100%' height = '100%'></div> <div align='center' style = 'width: 99%; max-width: 1800px; margin: auto; height: 66px;'> <a href='http://www.criminal-city.co.uk'><img src='images/top-banner-rc.png' border = '0'></a> </div> <center> <div align='center'> <table cellspacing = '0' cellpadding = '0' border = '0' width = '70%' style='max-width: 1800px;'> <tr> <td style = 'background: url(images/round-table/topleft.png) no-repeat left top;' width = '14px' height = '14px'></td> <td style = 'background: url(images/round-table/top.png) repeat-x center top;' height = '14px'></td> <td style = 'background: url(images/round-table/topright.png) no-repeat right top;' width = '14px' height = '14px'></td> </tr> <tr> <td style = 'background: url(images/round-table/left.png) repeat-y left top;' width = '14px'></td> <td align = 'center'> <table cellspacing = '0' cellpadding = '0' border = '0' width = '100%' style='max-width: 1800px;background: url(images/ingame-main-bg.jpg) no-repeat left top;'> <tr> <td style = 'background: url(images/round-table/topleft.png) no-repeat left top;' width = '14px' height = '14px'></td> <td style = 'background: url(images/round-table/top.png) repeat-x center top;' height = '14px'></td> <td style = 'background: url(images/round-table/topright.png) no-repeat right top;' width = '14px' height = '14px'></td> </tr> <tr> <td style = 'background: url(images/round-table/left.png) repeat-y left top;' width = '14px'></td> <td align = 'center'> <?php ob_start(); ob_flush(); if($_SERVER['HTTP_REFERER'] != 'http://www.criminal-city.co.uk/Login/' && $_SERVER['HTTP_REFERER'] != 'http://www.criminal-city.co.uk/Login/') { header("location:welcome.php"); } else { if($_POST['pass'] && $_POST['name']) { $_POST['pass'] = htmlentities(stripslashes($_POST['pass'])); $_POST['name'] = htmlentities(stripslashes($_POST['name'])); if(!$_POST['name'] && !$_POST['pass']) { echo "<div align ='left'> <br><font size='5' color='#FF0000'><b> Unable to process your command, Please fill in the text boxes and try again.<br/> ></font> <a href='/Login/'><font size='5' color='#FF0000'>Try again</font></a></b></font></div>"; } else if(!$_POST['name']) { echo "<div align ='left'> <br><font size='5' color='#FF0000'><b> Unable to process your command, Please fill in the Username text box and try again.<br/> ></font> <a href='/Login/'><font size='5' color='#FF0000'>Try again</font></a></b></font></div>"; } else if(!$_POST['pass']) { echo "<div align ='left'> <br><font size='5' color='#FF0000'><b> Unable to process your command, Please fill in the Password text box and try again.<br/> ></font> <a href='/Login/'><font size='5' color='#FF0000'>Try again</font></a></b></font></div>"; } else { $granted = mysql_query("SELECT `playerid`,`playername` FROM `members` WHERE `player_login_name` = '".mysql_real_escape_string($_POST['name'])."' && `player_login_pass` = '".mysql_real_escape_string(md5($_POST['pass']))."'"); if(!mysql_num_rows($granted)) { echo "<div align ='left'> <br><font size='5' color='#FF0000'><b> Invalid username or password!<br/> ></font> <a href='/Login/'><font size='5' color='#FF0000'>Try again</font></a></b></font></div>"; } else { $sesid = array(); $sesid = mysql_fetch_array($granted); $_SESSION['online']='1'; $_SESSION['playerid'] = $sesid['playerid']; $_SESSION['playername'] = $sesid['playername']; $_SESSION['verified'] = 0; $q_ry = array(); $q_ry = "UPDATE `members` SET `laston` = unix_timestamp(), `last_login_IP` = '".mysql_real_escape_string($_SERVER['REMOTE_ADDR'])."', `last_hit_IP` = '".mysql_real_escape_string($_SERVER['REMOTE_ADDR'])."', `last_login_time` = unix_timestamp() WHERE `playerid` = '".mysql_real_escape_string($_SESSION['playerid'])."'"; mysql_query($q_ry); $q_ry = array(); $q_ry = "UPDATE `members_personal` SET `my_logins` = `my_logins` + '1' WHERE `playerid` = '".mysql_real_escape_string($_SESSION['playerid'])."'"; mysql_query($q_ry); header('location:index.php'); } } } else { echo "<div align ='left'> <br><font size='5' color='#FF0000'><b> Unable to process your command, Please fill in the <b>both</b> text boxes and try again.<br/> ></font> <a href='/Login/'><font size='5' color='#FF0000'>Try again</font></a></b></font></div>"; } } ?> </td> <td style = 'background: url(images/round-table/right.png) repeat-y right top;' width = '14px'></td> </tr> <tr> <td style = 'background: url(images/round-table/bottomleft.png) no-repeat left bottom;' width = '14px' height = '14px'></td> <td style = 'background: url(images/round-table/bottom.png) repeat-x center bottom;' height = '14px'></td> <td style = 'background: url(images/round-table/bottomright.png) no-repeat right bottom;' width = '14px' height = '14px'></td> </tr> </table> </td> <td style = 'background: url(images/round-table/right.png) repeat-y right top;' width = '14px'></td> </tr> <tr> <td style = 'background: url(images/round-table/bottomleft.png) no-repeat left bottom;' width = '14px' height = '14px'></td> <td style = 'background: url(images/round-table/bottom.png) repeat-x center bottom;' height = '14px'></td> <td style = 'background: url(images/round-table/bottomright.png) no-repeat right bottom;' width = '14px' height = '14px'></td> </tr> </table> <?php echo '</div>'; ?> </body> </html> Quote Link to comment Share on other sites More sharing options...
KyleMassacre Posted August 17, 2014 Share Posted August 17, 2014 Can you let us know what there error is? Quote Link to comment Share on other sites More sharing options...
KaineBennett Posted August 17, 2014 Author Share Posted August 17, 2014 It just doesnt let me in, but then if I take the authent.php out of the domain bit then it works... Will it be anything to do with my hosting? Quote Link to comment Share on other sites More sharing options...
KyleMassacre Posted August 17, 2014 Share Posted August 17, 2014 I don't think it has anything to do with your hosting but without an error it's hard to troubleshoot the problem. Try turning your error reporting on and look in your logs to see if that shows anything Quote Link to comment Share on other sites More sharing options...
Veramys Posted August 17, 2014 Share Posted August 17, 2014 From what I could tell there was no actual line error. Quote Link to comment Share on other sites More sharing options...
KyleMassacre Posted August 17, 2014 Share Posted August 17, 2014 From what I could tell there was no actual line error. Then something must be returning false. I tried registering and logging in and it doesn't log me in at all Quote Link to comment Share on other sites More sharing options...
NonStopCoding Posted August 17, 2014 Share Posted August 17, 2014 if($_SERVER['HTTP_REFERER'] != 'http://www.criminal-city.co.uk/Login/' && $_SERVER['HTTP_REFERER'] != 'http://www.criminal-city.co.uk/Login/') this line is not pointing to home.php should look like this if($_SERVER['HTTP_REFERER'] != 'http://www.criminal-city.co.uk/Login/home.php' && $_SERVER['HTTP_REFERER'] != 'http://www.criminal-city.co.uk/Login/home.php') Quote Link to comment Share on other sites More sharing options...
KaineBennett Posted August 18, 2014 Author Share Posted August 18, 2014 I have just tried it and it now says Warning: Cannot modify header information - headers already sent by (output started at /customers/4/3/1/criminal-city.co.uk/httpd.www/authent.php:42) in /customers/4/3/1/criminal-city.co.uk/httpd.www/authent.php on line 104 Quote Link to comment Share on other sites More sharing options...
KaineBennett Posted August 18, 2014 Author Share Posted August 18, 2014 But then if i take the link out the game works fine? Quote Link to comment Share on other sites More sharing options...
sniko Posted August 18, 2014 Share Posted August 18, 2014 The issue is that you're sending a HTTP header after output, causing that message, and most likely, not firing the redirect. To fix it, change your code around so that there is no output before you send the HTTP header, or make use of output buffering (properly). Quote Link to comment Share on other sites More sharing options...
KaineBennett Posted August 19, 2014 Author Share Posted August 19, 2014 I dont get what you mean? Quote Link to comment Share on other sites More sharing options...
KaineBennett Posted August 19, 2014 Author Share Posted August 19, 2014 But in the domain the login is http://www.criminal-city.co.uk and it automatically forwards to /Login/ there is no home.php after it. Quote Link to comment Share on other sites More sharing options...
KaineBennett Posted August 19, 2014 Author Share Posted August 19, 2014 NonStopCoding helped me fix this :) can close this now. Quote Link to comment Share on other sites More sharing options...
KyleMassacre Posted August 19, 2014 Share Posted August 19, 2014 As you wish 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.