Hello and welcome to our community! Is this your first visit?
Register
Enjoy an ad free experience by logging in. Not a member yet? Register.
Results 1 to 7 of 7
  1. #1
    New Coder
    Join Date
    Jul 2010
    Posts
    30
    Thanks
    3
    Thanked 0 Times in 0 Posts

    Internal Server Error

    Dear Coders,

    I'm having a problem with a PHP script. I get this error:
    Internal Server Error

    The server encountered an internal error or misconfiguration and was unable to complete your request.

    Please contact the server administrator, support@one.com and inform them of the time the error occurred, and anything you might have done that may have caused the error.

    More information about this error may be available in the server error log.
    I don't have a .htaccess file, but I know that this is what often causes an error like this.
    My hope is that one of you maybe can see what causes this error, because I have tried for a long time now - with no luck :s


    Thanks,
    walkie

    Below you can see the page on which the error occures and the pages included:


    Sitout.php:
    PHP Code:
    <? 
    require('includes/gen_inc.php'); 
    require(
    'includes/inc_sitout.php'); 
    ?>
    <html>
    <head>
    <title><? echo TITLE?></title>
    <meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
    <link rel="stylesheet" href="css/poker.css" type="text/css">
    <script language="JavaScript" type="text/JavaScript" >
    function countdown(passcount){
    if(passcount > 0){
    document.getElementById('sitout').innerHTML = '<font color="black" size="4"><b>'+passcount+'</b></font>';
    passcount = (passcount-1);
    var e = passcount;
    setTimeout(function(){countdown(passcount)},1000);
    }else{
    parent.document.location.href = "lobby.php"; 
    }
    }
    </script>
    </head>

    <body bgcolor="#000000" text="#CCCCCC" onLoad="countdown('<? echo $start?>');">
    <table width="772" border="0" cellspacing="0" cellpadding="2" align="center" bgcolor="#1B1B1B">
      <tr> 
        <td valign="top" bgcolor="#333333"> 
          <table width="100%" border="0" cellspacing="0" cellpadding="1">
            <tr> 
              <td> 
                <? require('includes/scores.php'); ?>
              </td>
            </tr>
            <tr> 
              <td>
                <table width="100%" border="0" cellspacing="0" cellpadding="10">
                  <tr>
                    <td class="fieldsethead" align="center"><b> 
                      <? echo SITOUT_TIMER?>
                      </b></td>
                  </tr>
                  <tr>
                    <td>
                      <div align="center">
                        <table width="60%" border="0" cellspacing="0" cellpadding="5" bgcolor="#FFFF99">
                          <tr>
                            <td align="center">
                              <div id="sitout"><font face="Verdana, Arial, Helvetica, sans-serif" size="6"></font></div>
                            </td>
                          </tr>
                        </table>
                      </div>
                    </td>
                  </tr>
                </table>
              </td>
            </tr>
          </table>
        </td>
        <td width="650" class="fieldsethead" valign="top" height="100%">
          <table width="100%" border="0" cellspacing="0" cellpadding="3">
            <tr> 
              <td bgcolor="#333333"><b><font size="3"><i><? echo SITOUT?></i></font></b></td>
            </tr>
          </table>
          <b><font size="3"><br>
          </font></b> 
          
          <b><font size="3"> </font></b><br>
        </td>
      </tr>
    </table>

    </body>
    </html>


    gen_inc.php:
    PHP Code:
    <? require('configure.php');
    $host DB_SERVER;
    $ln DB_SERVER_USERNAME;
    $pw DB_SERVER_PASSWORD;
    $db DB_DATABASE;
    mysql_connect("$host""$ln""$pw") or die("Unable to connect to database");
    mysql_select_db("$db") or die("Unable to select database");
    require(
    'tables.php');
    require(
    'settings.php');
    session_start();
    $plyrname addslashes($_SESSION['playername']);
    $SGUID addslashes($_SESSION['SGUID']);
    $valid false;
    $ADMIN false;
    $gID '';
    if ((
    $plyrname != '') && ($SGUID != '')) {
        
    $idq mysql_query("select GUID, banned, gID, vID from " DB_PLAYERS " where username = '" $plyrname "' and GUID = '" $SGUID "' ");
        
    $idr mysql_fetch_array($idq);
        
    $gID $idr['gID'];
        
    $gameID $idr['vID'];
        if ((
    mysql_num_rows($idq) == 1) && ($idr['banned'] != 1)) $valid true;
        
    $siteadmin ADMIN_USERS;
        if (
    $plyrname != '') {
            
    $time time();
            
    $admins = array();
            
    $adminraw explode(','$siteadmin);
            
    $i 0;
            while (
    $adminraw[$i] != '') {
                
    $admins[$i] = $adminraw[$i];
                
    $i++;
            } 
            if (
    in_array($plyrname$admins)) $ADMIN true;
        } 

    require(
    'p_inc.php');
    require(
    'language.php');
    if ((
    $_SESSION[SESSNAME] != '') && (MEMMOD == 1) && ($plyrname == '')) {
        
    $time time();
        
    $sessname addslashes($_SESSION[SESSNAME]);
        
    $usrq mysql_query("select username from " DB_PLAYERS " where sessname = '" $sessname "' ");
        if (
    mysql_num_rows($usrq) == 1) {
            
    $usrr mysql_fetch_array($usrq);
            
    $usr $usrr['username'];
            
    $GUID randomcode(32);
            
    $_SESSION['playername'] = $usr;
            
    $_SESSION['SGUID'] = $GUID;
            
    $ip $_SERVER['REMOTE_ADDR'];
            
    $result mysql_query("update " DB_PLAYERS " set ipaddress = '" $ip "', lastlogin = '" $time "' , GUID = '" $GUID "' where username = '" $usr "' ");
            
    $valid true;
        } 

    $time time();
    $tq mysql_query("select waitimer from " DB_PLAYERS " where username = '" $plyrname "' ");
    $tr mysql_fetch_array($tq);
    $waitimer $tr['waitimer'];
    if (
    $waitimer $timeheader('Location sitout.php');
    ?>

    inc_sitout.php
    PHP Code:
    <?
    $time 
    time();
    $tq mysql_query("select waitimer from ".DB_PLAYERS." where username = '".$plyrname."' ");
    $tr mysql_fetch_array($tq);
    $waitimer $tr['waitimer'];
    if((
    $waitimer-1) <= $time){
        
    header('Location: lobby.php');
        die();
    }
    $start $waitimer-$time;
    ?>

  • #2
    Regular Coder
    Join Date
    Jul 2005
    Location
    Oxfordshire, UK
    Posts
    144
    Thanks
    0
    Thanked 0 Times in 0 Posts
    In your pages where you have <? try replacing it with <?php

  • #3
    New Coder
    Join Date
    Jul 2010
    Posts
    30
    Thanks
    3
    Thanked 0 Times in 0 Posts
    Hi robojob,

    Thank you for your answer.

    That didn't help sorry

  • #4
    Senior Coder
    Join Date
    Jul 2009
    Location
    South Yorkshire, England
    Posts
    2,318
    Thanks
    6
    Thanked 304 Times in 303 Posts
    Check your webserver error logs.

  • #5
    New Coder
    Join Date
    Jul 2010
    Posts
    30
    Thanks
    3
    Thanked 0 Times in 0 Posts
    Hi Matt,

    I have checked the logs, and they haven't got anything relevant as far as I know.
    Maybe you can get anything out of it:

    Code:
    www.xxx.dk 62.22.53.100 - - [30/May/2011:13:36:30 +0200] "GET /includes/push_p.php?ts=1306755375&h=5&m=3&f=0 HTTP/1.1" 200 - "http://www.xxx.dk/p.php" "Mozilla/5.0 (Windows NT 5.1) AppleWebKit/534.24 (KHTML, like Gecko) Chrome/11.0.696.68 Safari/534.24"
    www.xxx.dk 62.22.53.100 - - [30/May/2011:13:36:31 +0200] "GET /p.php?action=leave HTTP/1.1" 500 20198 "http://www.xxx.dk/p.php" "Mozilla/5.0 (Windows NT 5.1) AppleWebKit/534.24 (KHTML, like Gecko) Chrome/11.0.696.68 Safari/534.24"
    www.xxx.dk 62.22.53.100 - - [30/May/2011:13:36:31 +0200] "GET /sitout.php HTTP/1.1" 500 535 "http://www.xxx.dk/p.php" "Mozilla/5.0 (Windows NT 5.1) AppleWebKit/534.24 (KHTML, like Gecko) Chrome/11.0.696.68 Safari/534.24"

  • #6
    Super Moderator Inigoesdr's Avatar
    Join Date
    Mar 2007
    Location
    Florida, USA
    Posts
    3,647
    Thanks
    2
    Thanked 406 Times in 398 Posts
    walkie, that is the access_log, not the error_log. The error log should contain specific errors, line numbers, files, etc.

  • #7
    New Coder
    Join Date
    Jul 2010
    Posts
    30
    Thanks
    3
    Thanked 0 Times in 0 Posts
    Thanks for your answer Inigoesdr.
    I have just requested the error log from my provider. Will post it here when i get it.


  •  

    Posting Permissions

    • You may not post new threads
    • You may not post replies
    • You may not post attachments
    • You may not edit your posts
    •