Jump to content
MakeWebGames

RC Engine help: authent.php


KaineBennett

Recommended Posts

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>
Link to comment
Share on other sites

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')
Link to comment
Share on other sites

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).

Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...