mastercjb Posted April 9, 2012 Share Posted April 9, 2012 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>'; ?> Quote Link to comment https://forums.phpfreaks.com/topic/260595-php-536-getting-error-page/ Share on other sites More sharing options...
Muddy_Funster Posted April 9, 2012 Share Posted April 9, 2012 ...and the error is??? Quote Link to comment https://forums.phpfreaks.com/topic/260595-php-536-getting-error-page/#findComment-1335580 Share on other sites More sharing options...
mastercjb Posted April 9, 2012 Author Share Posted April 9, 2012 HTTP Error 500 (Internal Server Error): An unexpected condition was encountered while the server was attempting to fulfill the request. Quote Link to comment https://forums.phpfreaks.com/topic/260595-php-536-getting-error-page/#findComment-1335675 Share on other sites More sharing options...
Muddy_Funster Posted April 9, 2012 Share Posted April 9, 2012 I think it's likely this line, take the @ off and see what happes then $file = trim(@file_get_contents('http://hiscore.runescape.com/index_lite.ws?player='.$user));//Runescape high scores Quote Link to comment https://forums.phpfreaks.com/topic/260595-php-536-getting-error-page/#findComment-1335680 Share on other sites More sharing options...
AyKay47 Posted April 9, 2012 Share Posted April 9, 2012 One thing that is wring is the <body> and <html> tags are ended before you output the table. Quote Link to comment https://forums.phpfreaks.com/topic/260595-php-536-getting-error-page/#findComment-1335682 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.