Jump to content

Recommended Posts

Im sure the PHP 5.3.6 changed something so the script doesnt work. Unless something was miscoded. Its a high scores table for a game called runescape online. The script takes information from there and displays it on this table for whatever username you type in. However im just getting an error screen now that i have 5.3.6.....

 

 

<html>
<head>
<title>Runescape Stat Checker Created By Misterkid</title>
</head>
<form method="post" action="scores.php"  id="searchform">
<table border="0" align="center">
        <tr>
           <td ><h3 align ="center" >Username</h3></td>
          <td ><input  type="text" name="username"></td>
          <td ><input  type="submit" name="submit" value="Search"></td>
            <tr >
            <a href="http://www.runescape.com/game.ws?j=1" target="_blank"><center><img src="http://forum.ragezone.com/images/runescape_logo.png" border="0"></center></a>
            </tr>
        </tr>
  </table>
</form>  
<p></body>
</html>
<?php
echo'<table width="200" border="2" align="center" bgcolor="#666666" align="left">';
if (!isset($_POST['username'])) 
{
    echo'<tr><td>';
    die("Search a user");
    echo '</td></tr>';
}
$user = $_POST['username'];//'green098';//user
if ($_POST['username'])
{
    $file = trim(@file_get_contents('http://hiscore.runescape.com/index_lite.ws?player='.$user));//Runescape high scores
    $stats = explode(",",$file);
    
    if(!isset($stats [1])) 
    {
        echo'<tr><td>';
        die('User not found');
        echo '</td></tr>';
    }
        
    $checkRanked = $stats[0];
    if($stats[0] != '-1')
    {
        echo'<tr><td>';
        echo('Rank: '.$stats[0].'<br>');//Prints rank
        echo '</td></tr>';
    }
    else
    {
        echo'<tr><td>';
        echo('Rank: Not Ranked<br>');
        echo '</td></tr>';
    }
    echo'<tr><td>';
    echo('Total Level: '.$stats[1].'<br>');
    echo '</td></tr>';
    $totalExp = $stats[2];//convert to string
    $totalExpSp = preg_split('/\s+/', $totalExp);
    echo'<tr><td>';
    echo('Total Exp: '.$totalExpSp[0].'<br>');    
    echo '</td></tr>';
    echo'<tr><td>';
    echo('Attack: '.$stats[3].'<br>');
    echo '</td></tr>';
    echo'<tr><td>';
    echo('Defance: '.$stats[7].'<br>');
    echo '</td></tr>';
    echo'<tr><td>';
    echo('Constitution: '.$stats[9].'<br>');
    echo '</td></tr>';
    echo'<tr><td>';
    echo('Ranged: '.$stats[11].'<br>');
    echo '</td></tr>';
    echo'<tr><td>';
    echo('Prayer: '.$stats[13].'<br>');
    echo '</td></tr>';
    echo'<tr><td>';
    echo('Magic: '.$stats[15].'<br>');
    echo '</td></tr>';
    echo'<tr><td>';
    echo('Cooking: '.$stats[17].'<br>');
    echo '</td></tr>';
    echo'<tr><td>';
    echo('Woodcutting: '.$stats[19].'<br>');
    echo '</td></tr>';
    echo'<tr><td>';
    echo('Fletching: '.$stats[21].'<br>');
    echo '</td></tr>';
    echo'<tr><td>';
    echo('Fishing: '.$stats[23].'<br>');
    echo '</td></tr>';
    echo'<tr><td>';
    echo('Firemaking: '.$stats[25].'<br>');
    echo '</td></tr>';
    echo'<tr><td>';
    echo('Crafting: '.$stats[27].'<br>');
    echo '</td></tr>';
    echo'<tr><td>';
    echo('Smithing: '.$stats[29].'<br>');
    echo '</td></tr>';
    echo'<tr><td>';
    echo('Mining: '.$stats[31].'<br>');
    echo '</td></tr>';
    echo'<tr><td>';
    echo('Herblore: '.$stats[33].'<br>');
    echo '</td></tr>';
    echo'<tr><td>';
    echo('Agility: '.$stats[35].'<br>');
    echo '</td></tr>';
    echo'<tr><td>';
    echo('Thieving: '.$stats[37].'<br>');
    echo '</td></tr>';
    echo'<tr><td>';
    echo('Slayer: '.$stats[39].'<br>');
    echo '</td></tr>';
    echo'<tr><td>';
    echo('Farming: '.$stats[41].'<br>');
    echo '</td></tr>';
    echo'<tr><td>';
    echo('Runecrafting: '.$stats[43].'<br>');
    echo '</td></tr>';
    echo'<tr><td>';
    echo('Hunter: '.$stats[45].'<br>');
    echo '</td></tr>';
    echo'<tr><td>';
    echo('Construction: '.$stats[47].'<br>');
    echo '</td></tr>';
    echo'<tr><td>';
    echo('Summoning: '.$stats[49].'<br>');
    echo '</td></tr>';
    echo'<tr><td>';
    echo('Dungeoneering: '.$stats[51].'<br>');
    echo '</td></tr>';
}
else
{
    echo('Search for a user');
}    
    echo'</table>';
?>

Link to comment
https://forums.phpfreaks.com/topic/260595-php-536-getting-error-page/
Share on other sites

This thread is more than a year old. Please don't revive it unless you have something important to add.

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.   Restore formatting

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

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.