Jump to content

rswildy

Members
  • Posts

    98
  • Joined

  • Last visited

Everything posted by rswildy

  1. <FORM> <INPUT TYPE=BUTTON VALUE="Smile" onClick="document.applet.setFieldText(document.applet.getFieldText()+':)');document.applet.requestSourceFocus()"> <INPUT TYPE=BUTTON VALUE="Chanlist" onClick="document.applet.sendString('/list')"></FORM> How can i transform those into pictures so when you click the image it will do EXACTLY the same.Thanx, Rswildy
  2. rswildy

    Setting default ID

    the current code is <?php if (!isset($_REQUEST['id'])) { include("pages/index.inc.php"); exit();}if ( $_GET['id'] == 1 ) { include("pages/index.inc.php"); }if ( $_GET['id'] == 2) { include("pages/another_page.inc.php");}?> Now if they type an ID that is invalid i would like it to redirect them to index.php for example ID or ID= and ID=number/word whatever so it only takes them to another page if the ID is valid so index.php?id=1 would work where index.php?id=11 wouldnt, Thanx, Rswildy.
  3. How would i go about making an if else statement that will do the following.If user is on page index.php it will redirect user to index.php?id=1 but if they are on index.php?id=whatever the redirection script will have no affect.Thanx, Rswildy.
  4. I don't quite understand that, Also now im wondering lets say the page hiscores is located at ?id=hiscore then looking up user so output of my url is ?id=hiscore&user=user+name now lets say i wanted to add a private hiscore for one stat alone for example if they go to ?id=hiscore&uer=user+name is the current output the code is: <html> <head> <title>Hiscore Lookup</title> <style> body { font-family: sans-serif; font-size: 10px; background: #CCCCCC; } div { margin: 0 auto; width: 190; padding: 10px; border: 1px solid black; background: #E0E0E0; } table { width: 300px; background: #E0E0E0; border: 1px solid black; margin: 0 auto; } td { padding: 3px; font-size: 10px; } input { font-size: 10px; } </style> </head> <body> <center> <div> Enter a name:<br /> <form action="<?php echo $_SERVER['SCRIPT_NAME']; ?>" method="get"> <input type="hidden" name="id" value="hiscore"> <input type="text" name="user" value="<?php echo $_GET['user']?>" /> <input type="submit" value="Go" /> </form> </div> </center> <br /><center><?phpif (isset($_GET['user'])){ $skill_list = array("Attack", "Defence", "Strength", "Hitpoints", "Ranged", "Prayer", "Magic", "Cooking", "Woodcutting", "Fletching", "Fishing", "Firemaking", "Crafting", "Smithing", "Mining", "Herblore", "Agility", "Thieving", "Slayer", "Farming", "Runecraft", "Hunter", "Construction"); $contents = ""; $handle = fopen("http://hiscore.runescape.com/lang/en/aff/runescape/hiscorepersonal.ws?user1=".urlencode($_GET['user']),"r"); if($handle) { while (!feof($handle)) { $contents .= fread($handle, 8192); } fclose($handle); } echo "<table cellpadding=\"0\" cellspacing=\"0\">"; echo "<tr>"; echo "<td style=\"border-bottom: 1px solid black;\">Skill</td>"; echo "<td style=\"border-bottom: 1px solid black;\">Rank</td>"; echo "<td style=\"border-bottom: 1px solid black;\">Level</td>"; echo "<td style=\"border-bottom: 1px solid black;\">XP</td>"; echo "</tr>"; $bg = false; $found_skills = array(); $skills = parse($contents); foreach ($skills as $info) { if ($bg) echo "<tr style=\"background: #D0D0D0;\">"; else echo "<tr>"; echo "<td>{$info['skill']}</td>"; echo "<td>{$info['rank']}</td>"; echo "<td>{$info['level']}</td>"; echo "<td>{$info['xp']}</td>"; echo "</tr>"; $found_skills[] = $info['skill']; $bg = !$bg; } $missing_skills = array_diff($skill_list, $found_skills); foreach($missing_skills as $skill) { if ($bg) echo "<tr style=\"background: #D0D0D0;\">"; else echo "<tr>"; echo "<td>{$skill}</td>"; echo "<td>--</td>"; echo "<td>--</td>"; echo "<td>--</td>"; echo "</tr>"; $bg = !$bg; } echo "</table>";}function parse($contents){ $matches = array(); $pattern = "@<tr>\\s<td.*><img.*></td>\\s<td.*><a.*>\\s([^<]+)\\s</a></td>\\s<td.*>([0-9,\\s]*)</td>\\s<td.*>([0-9,\\s]*)</td>\\s<td.*>([0-9,\\s]*)</td>\\s</tr>@imsU"; $nr_matches = preg_match_all($pattern, $contents, $matches); $retval = array(); $i = 0; for ($i = 0; $i < count($matches[1]); $i++) { $retval[$i]['skill'] = $matches[1][$i]; $retval[$i]['rank'] = $matches[2][$i]; $retval[$i]['level'] = $matches[3][$i]; $retval[$i]['xp'] = $matches[4][$i]; } return $retval;}?></center> </body></html> Now i don't want to remove the full hiscore i just want to make it so if they url that is used is ?id=hiscore&user=user+name&stat=attack would just show the attack stats and will not show any other stats, it would also be ok if they choose what other stats to show example id=hiscore&user=user+name&stat=attack&stat=slayer&stat=firemaking if you could do that i would be very greatfull.Thanx for your time, rswildy.
  5. I've messed with the code, Still.. I removed the td img and it shows overall. But i want to position it at the bottom in bold so it stands out.
  6. Works but.. For me if you dont enter a username it wont show any of the tables where on youres it will show no matter what, Must be my host again (However, That really doesn't matter i'll let you know if i find any other problems with it). Also i've gotta say you've saved me ALOT of time formatting it, Now im wondering how can i make overall level show up too, also including total xp, total rank, total level just the same as getting from rs hiscores but even if it isnt ranked i would like to to apear at the bottom but looking in exactly the same format . however putting it like you've put levels wont work, You've gotta use a diffrent method for Overall level.
  7. My host are not doing anything about it...Is there a diffrent way for it to be done?
  8. I've informed my host.the link to hiscores is http://www.rswildy.co.uk/hiscores/hsc.phpIs there another way to do this then sinse my host may not get back to me.
  9. moved it up a directory now im getting errors http://runescape.rswildy.co.uk/AFprsfs/hiscores.phpCurrent code is: <?phpini_set("display_errors", 1);error_reporting(E_ALL);?><form action="hiscores.php" method="get" target="_self"> <td style="border-right-width:0px; border-right-style:solid; border-right-color:#261F13; width:66%; background-color:#362D1A;"><center><input type="text" name="name" value="<?php echo $_GET['name']?>" /><br /><?php$contents = ""; $handle = fopen("http://hiscore.runescape.com/lang/en/aff/runescape/hiscorepersonal.ws?user1=". urlencode($_GET['name']),"r");if($handle){ while (!feof($handle)) { $contents .= fread($handle, 8192); } fclose($handle);}function parse($skill_name){ global $contents; $matches = array(); $pattern = "@<tr>\\s<td.*><img.*></td>\\s<td.*><a.*>\\s" . $skill_name . "\\s</a></td>\\s<td.*>([0-9,\\s]*)</td>\\s<td.*>([0-9,\\s]*)</td>\\s<td.*>([0-9,\\s]*)</td>\\s</tr>@imsU"; $match_found = preg_match($pattern, $contents, $matches); $retval = array(); if ($match_found && $matches[1] != "") $retval['rank'] = $matches[1]; else $retval['rank'] = "--"; if ($match_found && $matches[2] != "") $retval['level'] = $matches[2]; else $retval['level'] = "--"; if ($match_found && $matches[3] != "") $retval['xp'] = $matches[3]; else $retval['xp'] = "--"; return $retval;}$info = parse("Attack");echo "Attack:<br>";echo "Rank: " . $info['rank'] . "<br>";echo "Level: " . $info['level'] . "<br>";echo "XP: " . $info['xp'] . "<br>";echo "<br>";$info = parse("Defence");echo "Defence:<br>";echo "Rank: " . $info['rank'] . "<br>";echo "Level: " . $info['level'] . "<br>";echo "XP: " . $info['xp'] . "<br>";echo "<br>";$info = parse("Strength");echo "Strength:<br>";echo "Rank: " . $info['rank'] . "<br>";echo "Level: " . $info['level'] . "<br>";echo "XP: " . $info['xp'] . "<br>";echo "<br>";$info = parse("Hitpoints");echo "Hitpoints:<br>";echo "Rank: " . $info['rank'] . "<br>";echo "Level: " . $info['level'] . "<br>";echo "XP: " . $info['xp'] . "<br>";echo "<br>";$info = parse("Ranged");echo "Ranged:<br>";echo "Rank: " . $info['rank'] . "<br>";echo "Level: " . $info['level'] . "<br>";echo "XP: " . $info['xp'] . "<br>";echo "<br>";$info = parse("Prayer");echo "Prayer:<br>";echo "Rank: " . $info['rank'] . "<br>";echo "Level: " . $info['level'] . "<br>";echo "XP: " . $info['xp'] . "<br>";echo "<br>";$info = parse("Magic");echo "Magic:<br>";echo "Rank: " . $info['rank'] . "<br>";echo "Level: " . $info['level'] . "<br>";echo "XP: " . $info['xp'] . "<br>";echo "<br>";$info = parse("Cooking");echo "Cooking:<br>";echo "Rank: " . $info['rank'] . "<br>";echo "Level: " . $info['level'] . "<br>";echo "XP: " . $info['xp'] . "<br>";echo "<br>";$info = parse("Woodcutting");echo "Woodcutting:<br>";echo "Rank: " . $info['rank'] . "<br>";echo "Level: " . $info['level'] . "<br>";echo "XP: " . $info['xp'] . "<br>";echo "<br>";$info = parse("Fletching");echo "Fletching:<br>";echo "Rank: " . $info['rank'] . "<br>";echo "Level: " . $info['level'] . "<br>";echo "XP: " . $info['xp'] . "<br>";echo "<br>";$info = parse("Fishing");echo "Fishing:<br>";echo "Rank: " . $info['rank'] . "<br>";echo "Level: " . $info['level'] . "<br>";echo "XP: " . $info['xp'] . "<br>";echo "<br>";$info = parse("Firemaking");echo "Firemaking:<br>";echo "Rank: " . $info['rank'] . "<br>";echo "Level: " . $info['level'] . "<br>";echo "XP: " . $info['xp'] . "<br>";echo "<br>";$info = parse("Crafting");echo "Crafting:<br>";echo "Rank: " . $info['rank'] . "<br>";echo "Level: " . $info['level'] . "<br>";echo "XP: " . $info['xp'] . "<br>";echo "<br>";$info = parse("Smithing");echo "Smithing:<br>";echo "Rank: " . $info['rank'] . "<br>";echo "Level: " . $info['level'] . "<br>";echo "XP: " . $info['xp'] . "<br>";echo "<br>";$info = parse("Mining");echo "Mining:<br>";echo "Rank: " . $info['rank'] . "<br>";echo "Level: " . $info['level'] . "<br>";echo "XP: " . $info['xp'] . "<br>";echo "<br>";$info = parse("Herblore");echo "Herblore:<br>";echo "Rank: " . $info['rank'] . "<br>";echo "Level: " . $info['level'] . "<br>";echo "XP: " . $info['xp'] . "<br>";echo "<br>";$info = parse("Agility");echo "Agility:<br>";echo "Rank: " . $info['rank'] . "<br>";echo "Level: " . $info['level'] . "<br>";echo "XP: " . $info['xp'] . "<br>";echo "<br>";$info = parse("Thieving");echo "Thieving:<br>";echo "Rank: " . $info['rank'] . "<br>";echo "Level: " . $info['level'] . "<br>";echo "XP: " . $info['xp'] . "<br>";echo "<br>";$info = parse("Slayer");echo "Slayer:<br>";echo "Rank: " . $info['rank'] . "<br>";echo "Level: " . $info['level'] . "<br>";echo "XP: " . $info['xp'] . "<br>";echo "<br>";$info = parse("Farming");echo "Farming:<br>";echo "Rank: " . $info['rank'] . "<br>";echo "Level: " . $info['level'] . "<br>";echo "XP: " . $info['xp'] . "<br>";echo "<br>";$info = parse("Runecraft");echo "Runecraft:<br>";echo "Rank: " . $info['rank'] . "<br>";echo "Level: " . $info['level'] . "<br>";echo "XP: " . $info['xp'] . "<br>";echo "<br>";$info = parse("Hunter");echo "Hunter:<br>";echo "Rank: " . $info['rank'] . "<br>";echo "Level: " . $info['level'] . "<br>";echo "XP: " . $info['xp'] . "<br>";echo "<br>";$info = parse("Construction");echo "Construction:<br>";echo "Rank: " . $info['rank'] . "<br>";echo "Level: " . $info['level'] . "<br>";echo "XP: " . $info['xp'] . "<br>";?></center> Errors found:ERROR 1 (inside name box)---------------<br /><b>Notice</b>: Undefined index: name in <b>/home/www/rswildy.co.uk/AFprs/AFprsfs/hiscores.php</b> on line <b>11</b><br /> Error 2---------------Notice: Undefined index: name in /home/www/rswildy.co.uk/AFprs/AFprsfs/hiscores.php on line 16Was fine on yours but now i see errors there too. This is really strange. I really need these hiscores
  10. Still not working the current code is: <?phpini_set("display_errors", 1);error_reporting(E_ALL);?><form action="hiscores.php" method="get" target="_self"> <td style="border-right-width:0px; border-right-style:solid; border-right-color:#261F13; width:66%; background-color:#362D1A;"><center><input type="text" name="name" value="<?php echo $_GET['name']?>" /><br /><?php$contents = ""; $handle = fopen("http://hiscore.runescape.com/lang/en/aff/runescape/hiscorepersonal.ws?user1=". urlencode($_GET['name']),"r");if($handle){ while (!feof($handle)) { $contents .= fread($handle, 8192); } fclose($handle);}function parse($skill_name){ global $contents; $matches = array(); $pattern = "@<tr>\\s<td.*><img.*></td>\\s<td.*><a.*>\\s" . $skill_name . "\\s</a></td>\\s<td.*>([0-9,\\s]*)</td>\\s<td.*>([0-9,\\s]*)</td>\\s<td.*>([0-9,\\s]*)</td>\\s</tr>@imsU"; $match_found = preg_match($pattern, $contents, $matches); $retval = array(); if ($match_found && $matches[1] != "") $retval['rank'] = $matches[1]; else $retval['rank'] = "--"; if ($match_found && $matches[2] != "") $retval['level'] = $matches[2]; else $retval['level'] = "--"; if ($match_found && $matches[3] != "") $retval['xp'] = $matches[3]; else $retval['xp'] = "--"; return $retval;}$info = parse("Attack");echo "Attack:<br>";echo "Rank: " . $info['rank'] . "<br>";echo "Level: " . $info['level'] . "<br>";echo "XP: " . $info['xp'] . "<br>";echo "<br>";$info = parse("Defence");echo "Defence:<br>";echo "Rank: " . $info['rank'] . "<br>";echo "Level: " . $info['level'] . "<br>";echo "XP: " . $info['xp'] . "<br>";echo "<br>";$info = parse("Strength");echo "Strength:<br>";echo "Rank: " . $info['rank'] . "<br>";echo "Level: " . $info['level'] . "<br>";echo "XP: " . $info['xp'] . "<br>";echo "<br>";$info = parse("Hitpoints");echo "Hitpoints:<br>";echo "Rank: " . $info['rank'] . "<br>";echo "Level: " . $info['level'] . "<br>";echo "XP: " . $info['xp'] . "<br>";echo "<br>";$info = parse("Ranged");echo "Ranged:<br>";echo "Rank: " . $info['rank'] . "<br>";echo "Level: " . $info['level'] . "<br>";echo "XP: " . $info['xp'] . "<br>";echo "<br>";$info = parse("Prayer");echo "Prayer:<br>";echo "Rank: " . $info['rank'] . "<br>";echo "Level: " . $info['level'] . "<br>";echo "XP: " . $info['xp'] . "<br>";echo "<br>";$info = parse("Magic");echo "Magic:<br>";echo "Rank: " . $info['rank'] . "<br>";echo "Level: " . $info['level'] . "<br>";echo "XP: " . $info['xp'] . "<br>";echo "<br>";$info = parse("Cooking");echo "Cooking:<br>";echo "Rank: " . $info['rank'] . "<br>";echo "Level: " . $info['level'] . "<br>";echo "XP: " . $info['xp'] . "<br>";echo "<br>";$info = parse("Woodcutting");echo "Woodcutting:<br>";echo "Rank: " . $info['rank'] . "<br>";echo "Level: " . $info['level'] . "<br>";echo "XP: " . $info['xp'] . "<br>";echo "<br>";$info = parse("Fletching");echo "Fletching:<br>";echo "Rank: " . $info['rank'] . "<br>";echo "Level: " . $info['level'] . "<br>";echo "XP: " . $info['xp'] . "<br>";echo "<br>";$info = parse("Fishing");echo "Fishing:<br>";echo "Rank: " . $info['rank'] . "<br>";echo "Level: " . $info['level'] . "<br>";echo "XP: " . $info['xp'] . "<br>";echo "<br>";$info = parse("Firemaking");echo "Firemaking:<br>";echo "Rank: " . $info['rank'] . "<br>";echo "Level: " . $info['level'] . "<br>";echo "XP: " . $info['xp'] . "<br>";echo "<br>";$info = parse("Crafting");echo "Crafting:<br>";echo "Rank: " . $info['rank'] . "<br>";echo "Level: " . $info['level'] . "<br>";echo "XP: " . $info['xp'] . "<br>";echo "<br>";$info = parse("Smithing");echo "Smithing:<br>";echo "Rank: " . $info['rank'] . "<br>";echo "Level: " . $info['level'] . "<br>";echo "XP: " . $info['xp'] . "<br>";echo "<br>";$info = parse("Mining");echo "Mining:<br>";echo "Rank: " . $info['rank'] . "<br>";echo "Level: " . $info['level'] . "<br>";echo "XP: " . $info['xp'] . "<br>";echo "<br>";$info = parse("Herblore");echo "Herblore:<br>";echo "Rank: " . $info['rank'] . "<br>";echo "Level: " . $info['level'] . "<br>";echo "XP: " . $info['xp'] . "<br>";echo "<br>";$info = parse("Agility");echo "Agility:<br>";echo "Rank: " . $info['rank'] . "<br>";echo "Level: " . $info['level'] . "<br>";echo "XP: " . $info['xp'] . "<br>";echo "<br>";$info = parse("Thieving");echo "Thieving:<br>";echo "Rank: " . $info['rank'] . "<br>";echo "Level: " . $info['level'] . "<br>";echo "XP: " . $info['xp'] . "<br>";echo "<br>";$info = parse("Slayer");echo "Slayer:<br>";echo "Rank: " . $info['rank'] . "<br>";echo "Level: " . $info['level'] . "<br>";echo "XP: " . $info['xp'] . "<br>";echo "<br>";$info = parse("Farming");echo "Farming:<br>";echo "Rank: " . $info['rank'] . "<br>";echo "Level: " . $info['level'] . "<br>";echo "XP: " . $info['xp'] . "<br>";echo "<br>";$info = parse("Runecraft");echo "Runecraft:<br>";echo "Rank: " . $info['rank'] . "<br>";echo "Level: " . $info['level'] . "<br>";echo "XP: " . $info['xp'] . "<br>";echo "<br>";$info = parse("Hunter");echo "Hunter:<br>";echo "Rank: " . $info['rank'] . "<br>";echo "Level: " . $info['level'] . "<br>";echo "XP: " . $info['xp'] . "<br>";echo "<br>";$info = parse("Construction");echo "Construction:<br>";echo "Rank: " . $info['rank'] . "<br>";echo "Level: " . $info['level'] . "<br>";echo "XP: " . $info['xp'] . "<br>";?></center> No errors are being showed.
  11. The current code is: <form action="hiscores.php" method="get" target="_self"> <td style="border-right-width:0px; border-right-style:solid; border-right-color:#261F13; width:66%; background-color:#362D1A;"><center><input type="text" name="name" value="<?php echo $_GET['name']?>" /><br /><?phpini_set("display_errors", 1);error_reporting(E_ALL);$contents = ""; $handle = fopen("http://hiscore.runescape.com/lang/en/aff/runescape/hiscorepersonal.ws?user1=".$_GET['name'],"r"); if($handle){ while (!feof($handle)) { $contents .= fread($handle, 8192); } fclose($handle);}function parse($skill_name){ global $contents; $matches = array(); $pattern = "@<tr>\\s<td.*><img.*></td>\\s<td.*><a.*>\\s" . $skill_name . "\\s</a></td>\\s<td.*>([0-9,\\s]*)</td>\\s<td.*>([0-9,\\s]*)</td>\\s<td.*>([0-9,\\s]*)</td>\\s</tr>@imsU"; $match_found = preg_match($pattern, $contents, $matches); $retval = array(); if ($match_found && $matches[1] != "") $retval['rank'] = $matches[1]; else $retval['rank'] = "--"; if ($match_found && $matches[2] != "") $retval['level'] = $matches[2]; else $retval['level'] = "--"; if ($match_found && $matches[3] != "") $retval['xp'] = $matches[3]; else $retval['xp'] = "--"; return $retval;}$info = parse("Attack");echo "Attack:<br>";echo "Rank: " . $info['rank'] . "<br>";echo "Level: " . $info['level'] . "<br>";echo "XP: " . $info['xp'] . "<br>";echo "<br>";$info = parse("Defence");echo "Defence:<br>";echo "Rank: " . $info['rank'] . "<br>";echo "Level: " . $info['level'] . "<br>";echo "XP: " . $info['xp'] . "<br>";echo "<br>";$info = parse("Strength");echo "Strength:<br>";echo "Rank: " . $info['rank'] . "<br>";echo "Level: " . $info['level'] . "<br>";echo "XP: " . $info['xp'] . "<br>";echo "<br>";$info = parse("Hitpoints");echo "Hitpoints:<br>";echo "Rank: " . $info['rank'] . "<br>";echo "Level: " . $info['level'] . "<br>";echo "XP: " . $info['xp'] . "<br>";echo "<br>";$info = parse("Ranged");echo "Ranged:<br>";echo "Rank: " . $info['rank'] . "<br>";echo "Level: " . $info['level'] . "<br>";echo "XP: " . $info['xp'] . "<br>";echo "<br>";$info = parse("Prayer");echo "Prayer:<br>";echo "Rank: " . $info['rank'] . "<br>";echo "Level: " . $info['level'] . "<br>";echo "XP: " . $info['xp'] . "<br>";echo "<br>";$info = parse("Magic");echo "Magic:<br>";echo "Rank: " . $info['rank'] . "<br>";echo "Level: " . $info['level'] . "<br>";echo "XP: " . $info['xp'] . "<br>";echo "<br>";$info = parse("Cooking");echo "Cooking:<br>";echo "Rank: " . $info['rank'] . "<br>";echo "Level: " . $info['level'] . "<br>";echo "XP: " . $info['xp'] . "<br>";echo "<br>";$info = parse("Woodcutting");echo "Woodcutting:<br>";echo "Rank: " . $info['rank'] . "<br>";echo "Level: " . $info['level'] . "<br>";echo "XP: " . $info['xp'] . "<br>";echo "<br>";$info = parse("Fletching");echo "Fletching:<br>";echo "Rank: " . $info['rank'] . "<br>";echo "Level: " . $info['level'] . "<br>";echo "XP: " . $info['xp'] . "<br>";echo "<br>";$info = parse("Fishing");echo "Fishing:<br>";echo "Rank: " . $info['rank'] . "<br>";echo "Level: " . $info['level'] . "<br>";echo "XP: " . $info['xp'] . "<br>";echo "<br>";$info = parse("Firemaking");echo "Firemaking:<br>";echo "Rank: " . $info['rank'] . "<br>";echo "Level: " . $info['level'] . "<br>";echo "XP: " . $info['xp'] . "<br>";echo "<br>";$info = parse("Crafting");echo "Crafting:<br>";echo "Rank: " . $info['rank'] . "<br>";echo "Level: " . $info['level'] . "<br>";echo "XP: " . $info['xp'] . "<br>";echo "<br>";$info = parse("Smithing");echo "Smithing:<br>";echo "Rank: " . $info['rank'] . "<br>";echo "Level: " . $info['level'] . "<br>";echo "XP: " . $info['xp'] . "<br>";echo "<br>";$info = parse("Mining");echo "Mining:<br>";echo "Rank: " . $info['rank'] . "<br>";echo "Level: " . $info['level'] . "<br>";echo "XP: " . $info['xp'] . "<br>";echo "<br>";$info = parse("Herblore");echo "Herblore:<br>";echo "Rank: " . $info['rank'] . "<br>";echo "Level: " . $info['level'] . "<br>";echo "XP: " . $info['xp'] . "<br>";echo "<br>";$info = parse("Agility");echo "Agility:<br>";echo "Rank: " . $info['rank'] . "<br>";echo "Level: " . $info['level'] . "<br>";echo "XP: " . $info['xp'] . "<br>";echo "<br>";$info = parse("Thieving");echo "Thieving:<br>";echo "Rank: " . $info['rank'] . "<br>";echo "Level: " . $info['level'] . "<br>";echo "XP: " . $info['xp'] . "<br>";echo "<br>";$info = parse("Slayer");echo "Slayer:<br>";echo "Rank: " . $info['rank'] . "<br>";echo "Level: " . $info['level'] . "<br>";echo "XP: " . $info['xp'] . "<br>";echo "<br>";$info = parse("Farming");echo "Farming:<br>";echo "Rank: " . $info['rank'] . "<br>";echo "Level: " . $info['level'] . "<br>";echo "XP: " . $info['xp'] . "<br>";echo "<br>";$info = parse("Runecraft");echo "Runecraft:<br>";echo "Rank: " . $info['rank'] . "<br>";echo "Level: " . $info['level'] . "<br>";echo "XP: " . $info['xp'] . "<br>";echo "<br>";$info = parse("Hunter");echo "Hunter:<br>";echo "Rank: " . $info['rank'] . "<br>";echo "Level: " . $info['level'] . "<br>";echo "XP: " . $info['xp'] . "<br>";echo "<br>";$info = parse("Construction");echo "Construction:<br>";echo "Rank: " . $info['rank'] . "<br>";echo "Level: " . $info['level'] . "<br>";echo "XP: " . $info['xp'] . "<br>";?></center>
  12. No but it's still not working correctly for whatever reason, However i've just added the code and im seeing -- but still some of the fields are missing for some users.
  13. Nope not working correctly. There is 23 skills in runescape, I've set them all. Now when you search someones name it will only show some results for example if i search wtf is zammy all i see is attack strength defence and hitpoints if i search low fighter i see them all. I may have made an error or not noticed in coding, Take a look please. <?php$contents = ""; $handle = fopen("http://hiscore.runescape.com/lang/en/aff/runescape/hiscorepersonal.ws?user1=".$_GET['name'],"r"); if($handle){ while (!feof($handle)) { $contents .= fread($handle, 8192); } fclose($handle);}function parse($skill_name){ global $contents; $pattern = "@<tr>\\s<td.*><img.*></td>\\s<td.*><a.*>\\s" . $skill_name . "\\s</a></td>\\s<td.*>([0-9,\\s]*)</td>\\s<td.*>([0-9,\\s]*)</td>\\s<td.*>([0-9,\\s]*)</td>\\s</tr>@imsU"; $matches = array(); preg_match($pattern, $contents, $matches); $retval = array('rank' => $matches[1], 'level' => $matches[2], 'xp' => $matches[3]); return $retval;}$info = parse("Attack");echo "Attack:<br>";echo "Rank: " . $info['rank'] . "<br>";echo "Level: " . $info['level'] . "<br>";echo "XP: " . $info['xp'] . "<br>";echo "<br>";$info = parse("Defence");echo "Defence:<br>";echo "Rank: " . $info['rank'] . "<br>";echo "Level: " . $info['level'] . "<br>";echo "XP: " . $info['xp'] . "<br>";echo "<br>";$info = parse("Strength");echo "Strength:<br>";echo "Rank: " . $info['rank'] . "<br>";echo "Level: " . $info['level'] . "<br>";echo "XP: " . $info['xp'] . "<br>";echo "<br>";$info = parse("Hitpoints");echo "Hitpoints:<br>";echo "Rank: " . $info['rank'] . "<br>";echo "Level: " . $info['level'] . "<br>";echo "XP: " . $info['xp'] . "<br>";echo "<br>";$info = parse("Ranged");echo "Ranged:<br>";echo "Rank: " . $info['rank'] . "<br>";echo "Level: " . $info['level'] . "<br>";echo "XP: " . $info['xp'] . "<br>";echo "<br>";$info = parse("Prayer");echo "Prayer:<br>";echo "Rank: " . $info['rank'] . "<br>";echo "Level: " . $info['level'] . "<br>";echo "XP: " . $info['xp'] . "<br>";echo "<br>";$info = parse("Magic");echo "Magic:<br>";echo "Rank: " . $info['rank'] . "<br>";echo "Level: " . $info['level'] . "<br>";echo "XP: " . $info['xp'] . "<br>";echo "<br>";$info = parse("Cooking");echo "Cooking:<br>";echo "Rank: " . $info['rank'] . "<br>";echo "Level: " . $info['level'] . "<br>";echo "XP: " . $info['xp'] . "<br>";echo "<br>";$info = parse("Woodcutting");echo "Woodcutting:<br>";echo "Rank: " . $info['rank'] . "<br>";echo "Level: " . $info['level'] . "<br>";echo "XP: " . $info['xp'] . "<br>";echo "<br>";$info = parse("Fletching");echo "Fletching:<br>";echo "Rank: " . $info['rank'] . "<br>";echo "Level: " . $info['level'] . "<br>";echo "XP: " . $info['xp'] . "<br>";echo "<br>";$info = parse("Fishing");echo "Fishing:<br>";echo "Rank: " . $info['rank'] . "<br>";echo "Level: " . $info['level'] . "<br>";echo "XP: " . $info['xp'] . "<br>";echo "<br>";$info = parse("Firemaking");echo "Firemaking:<br>";echo "Rank: " . $info['rank'] . "<br>";echo "Level: " . $info['level'] . "<br>";echo "XP: " . $info['xp'] . "<br>";echo "<br>";$info = parse("Crafting");echo "Crafting:<br>";echo "Rank: " . $info['rank'] . "<br>";echo "Level: " . $info['level'] . "<br>";echo "XP: " . $info['xp'] . "<br>";echo "<br>";$info = parse("Smithing");echo "Smithing:<br>";echo "Rank: " . $info['rank'] . "<br>";echo "Level: " . $info['level'] . "<br>";echo "XP: " . $info['xp'] . "<br>";echo "<br>";$info = parse("Mining");echo "Mining:<br>";echo "Rank: " . $info['rank'] . "<br>";echo "Level: " . $info['level'] . "<br>";echo "XP: " . $info['xp'] . "<br>";echo "<br>";$info = parse("Herblore");echo "Herblore:<br>";echo "Rank: " . $info['rank'] . "<br>";echo "Level: " . $info['level'] . "<br>";echo "XP: " . $info['xp'] . "<br>";echo "<br>";$info = parse("Agility");echo "Agility:<br>";echo "Rank: " . $info['rank'] . "<br>";echo "Level: " . $info['level'] . "<br>";echo "XP: " . $info['xp'] . "<br>";echo "<br>";$info = parse("Thieving");echo "Thieving:<br>";echo "Rank: " . $info['rank'] . "<br>";echo "Level: " . $info['level'] . "<br>";echo "XP: " . $info['xp'] . "<br>";echo "<br>";$info = parse("Slayer");echo "Slayer:<br>";echo "Rank: " . $info['rank'] . "<br>";echo "Level: " . $info['level'] . "<br>";echo "XP: " . $info['xp'] . "<br>";echo "<br>";$info = parse("Farming");echo "Farming:<br>";echo "Rank: " . $info['rank'] . "<br>";echo "Level: " . $info['level'] . "<br>";echo "XP: " . $info['xp'] . "<br>";echo "<br>";$info = parse("Runecraft");echo "Runecraft:<br>";echo "Rank: " . $info['rank'] . "<br>";echo "Level: " . $info['level'] . "<br>";echo "XP: " . $info['xp'] . "<br>";echo "<br>";$info = parse("Hunter");echo "Hunter:<br>";echo "Rank: " . $info['rank'] . "<br>";echo "Level: " . $info['level'] . "<br>";echo "XP: " . $info['xp'] . "<br>";echo "<br>";$info = parse("Construction");echo "Construction:<br>";echo "Rank: " . $info['rank'] . "<br>";echo "Level: " . $info['level'] . "<br>";echo "XP: " . $info['xp'] . "<br>";?></center><form action="hiscores.php" method="get" target="_self"> <td style="border-right-width:0px; border-right-style:solid; border-right-color:#261F13; width:66%; background-color:#362D1A;"><center><input type="text" name="name" value="<?php echo $_GET['name']?>" /><br /> Demo link: http://runescape.rswildy.co.uk/hiscores.php
  14. I figured out the leaving things out part :)Thanx for showing me how to display unranked data.Thanks for all your help and i really hope this is my last post today lol.
  15. Thankyou for your help and time, No doubt i will be back again soon.Also how can i make it so they are always visible so it will apear like this if not found/ranked:Strength:Rank: --Level: --XP: --And how can i make a seperate version (making 2 details) Where it only shows level no rank, XP.
  16. Looking nice, So how do i make a lookup displaying the levels of user enterd for example myurl.com/hiscore.php?name=userI very much doubt i could write my own php script like this, I've never wrote my own php script yet. I don't got much php expierience just started.
  17. Page Hiscore.runescape.comUser http://hiscore.runescape.com/hiscoreperson...er1=Low_FighterConstruction search http://hiscore.runescape.com/overall.ws?ta...ser=Low_Fighter
  18. Oh yeah i know lol sorry misread.EDIT: still getting it i get what you mean but ive just started php and this was a premade public script i edited, The new code is: <form action="hiscores.php" method="get" target="_self"> <td style="border-right-width:0px; border-right-style:solid; border-right-color:#261F13; width:66%; background-color:#362D1A;"><?php $handle = fopen("http://hiscore.runescape.com/lang/en/aff/runescape/hiscorepersonal.ws?user1=".$_GET['name'],"r"); if($handle){ while (!feof($handle)) { $contents .= fread($handle, 8192);} fclose($handle);}function GetLvl($skill){ $str1 = strstr($GLOBALS['contents'], '>'.chr(10).$skill.chr(10).'<'); if(strpos($str1, 'd co')<30) return '--'; $pos1 = strpos($str1, 't"',strpos($str1, 't"')+1)+3; return substr($str1, $pos1, strpos($str1,'<',$pos1)-$pos1);}function parse($skill) {return GetLvl($skill);} ?><center><input type="text" name="name" value="<?php echo $_GET['name']?>" /><br/><? echo ('<img src="http://runescape.rswildy.co.uk/AFprsfs/hiscore_image/attack.gif" alt="Attack" /> <font color="#FF9900">'.parse("Attack").'</font><img src="http://runescape.rswildy.co.uk/AFprsfs/hiscore_image/strength.gif" alt="Strength" /> <font color="#FF9900">'.parse("Strength").'</font><img src="http://runescape.rswildy.co.uk/AFprsfs/hiscore_image/defence.gif" alt="Defence" /> <font color="#FF9900">'.parse("Defence").'</font><img src="http://runescape.rswildy.co.uk/AFprsfs/hiscore_image/ranged.gif" alt="Ranged" /> <font color="#FF9900">'.parse("Ranged").'</font><img src="http://runescape.rswildy.co.uk/AFprsfs/hiscore_image/magic.gif" alt="Magic" /> <font color="#FF9900">'.parse("Magic").'</font><img src="http://runescape.rswildy.co.uk/AFprsfs/hiscore_image/prayer.gif" alt="Prayer" /> <font color="#FF9900">'.parse("Prayer").'</font><img src="http://runescape.rswildy.co.uk/AFprsfs/hiscore_image/hitpoints.gif" alt="Hitpoints" /> <font color="#FF9900">'.parse("Hitpoints").'</font><img src="http://runescape.rswildy.co.uk/AFprsfs/hiscore_image/cooking.gif" alt="Cooking" /> <font color="#FF9900">'.parse("Cooking").'</font><img src="http://runescape.rswildy.co.uk/AFprsfs/hiscore_image/fishing.gif" alt="Fishing" /> <font color="#FF9900">'.parse("Fishing").'</font><img src="http://runescape.rswildy.co.uk/AFprsfs/hiscore_image/fletching.gif" alt="Fletching" /> <font color="#FF9900">'.parse("Fletching").'</font><img src="http://runescape.rswildy.co.uk/AFprsfs/hiscore_image/farming.gif" alt="Farming" /> <font color="#FF9900">'.parse("Farming").'</font><img src="http://runescape.rswildy.co.uk/AFprsfs/hiscore_image/slayer.gif" alt="Slayer" /> <font color="#FF9900">'.parse("Slayer").'</font> <br/><img src="http://runescape.rswildy.co.uk/AFprsfs/hiscore_image/crafting.gif" alt="Crafting" /> <font color="#FF9900">'.parse("Crafting").'</font><img src="http://runescape.rswildy.co.uk/AFprsfs/hiscore_image/hunter.gif" alt="Hunter" /> <font color="#FF9900">'.parse("Hunter").'</font><img src="http://runescape.rswildy.co.uk/AFprsfs/hiscore_image/mining.gif" alt="Mining" /> <font color="#FF9900">'.parse("Mining").'</font><img src="http://runescape.rswildy.co.uk/AFprsfs/hiscore_image/smithing.gif" alt="Smithing" /> <font color="#FF9900">'.parse("Smithing").'</font><img src="http://runescape.rswildy.co.uk/AFprsfs/hiscore_image/firemaking.gif" alt="Firemaking" /> <font color="#FF9900">'.parse("Firemaking").'</font><img src="http://runescape.rswildy.co.uk/AFprsfs/hiscore_image/woodcutting.gif" alt="Woodcutting" /> <font color="#FF9900">'.parse("Woodcutting").'</font><img src="http://runescape.rswildy.co.uk/AFprsfs/hiscore_image/runecraft.gif" alt="Runecraft" /> <font color="#FF9900">'.parse("Runecraft").'</font><img src="http://runescape.rswildy.co.uk/AFprsfs/hiscore_image/thieving.gif" alt="Theiving" /> <font color="#FF9900">'.parse("Thieving").'</font><img src="http://runescape.rswildy.co.uk/AFprsfs/hiscore_image/herblore.gif" alt="Herblore" /> <font color="#FF9900">'.parse("Herblore").'</font><img src="http://runescape.rswildy.co.uk/AFprsfs/hiscore_image/agility.gif" alt="Agility" /> <font color="#FF9900">'.parse("Agility").'</font><img src="http://runescape.rswildy.co.uk/AFprsfs/hiscore_image/construction.gif" alt="Construction" /> <font color="#FF9900">'.parse("Construction").'</font><br /><font color="#FF9900"><b>Total Level:</b> '.parse("Overall").'</font>');?></center></td> </tr></table></form></body></html> So can someone show me how to make it pick up construction correctly without seeing name="submit" value="Search"> .
  19. But what do you mean save the $contents?
  20. Thanks for the help, I'll post the code when im finished tell me if i've fixed it.
  21. So what is the solution? If someone could think of an easy fix id be very gratefull
  22. Alright i set up hiscore http://runescape.rswildy.co.uk/AFprsfs/hiscores.phpbut when on a blank page why do i see name="submit" value="Search"> how do i remove it? the code is: <form action="hiscores.php" method="get" target="_self"> <td style="border-right-width:0px; border-right-style:solid; border-right-color:#261F13; width:66%; background-color:#362D1A;"><?php $handle = fopen("http://hiscore.runescape.com/lang/en/aff/runescape/hiscorepersonal.ws?user1=".$_GET['name'],"r"); if($handle){ while (!feof($handle)) { $contents .= fread($handle, 8192);} fclose($handle);}function GetLvl($skill){ $str1 = strstr($GLOBALS['contents'], '>'.chr(10).$skill.chr(10).'<'); if(strpos($str1, 'd co')<30) return '--'; $pos1 = strpos($str1, 't"',strpos($str1, 't"')+1)+3; return substr($str1, $pos1, strpos($str1,'<',$pos1)-$pos1);}function parse($skill) {return GetLvl($skill);} ?><center><input type="text" name="name" value="<?php echo $_GET['name']?>" /><br/><? echo ('<img src="http://runescape.rswildy.co.uk/AFprsfs/hiscore_image/attack.gif" alt="Attack" /> <font color="#FF9900">'.parse(Attack).'</font><img src="http://runescape.rswildy.co.uk/AFprsfs/hiscore_image/strength.gif" alt="Strength" /> <font color="#FF9900">'.parse(Strength).'</font><img src="http://runescape.rswildy.co.uk/AFprsfs/hiscore_image/defence.gif" alt="Defence" /> <font color="#FF9900">'.parse(Defence).'</font><img src="http://runescape.rswildy.co.uk/AFprsfs/hiscore_image/ranged.gif" alt="Ranged" /> <font color="#FF9900">'.parse(Ranged).'</font><img src="http://runescape.rswildy.co.uk/AFprsfs/hiscore_image/construction.gif" alt="Construction" /> <font color="#FF9900">'.parse(Construction).'</font><img src="http://runescape.rswildy.co.uk/AFprsfs/hiscore_image/magic.gif" alt="Magic" /> <font color="#FF9900">'.parse(Magic).'</font><img src="http://runescape.rswildy.co.uk/AFprsfs/hiscore_image/prayer.gif" alt="Prayer" /> <font color="#FF9900">'.parse(Prayer).'</font><img src="http://runescape.rswildy.co.uk/AFprsfs/hiscore_image/hitpoints.gif" alt="Hitpoints" /> <font color="#FF9900">'.parse(Hitpoints).'</font><img src="http://runescape.rswildy.co.uk/AFprsfs/hiscore_image/cooking.gif" alt="Cooking" /> <font color="#FF9900">'.parse(Cooking).'</font><img src="http://runescape.rswildy.co.uk/AFprsfs/hiscore_image/fishing.gif" alt="Fishing" /> <font color="#FF9900">'.parse(Fishing).'</font><img src="http://runescape.rswildy.co.uk/AFprsfs/hiscore_image/fletching.gif" alt="Fletching" /> <font color="#FF9900">'.parse(Fletching).'</font><img src="http://runescape.rswildy.co.uk/AFprsfs/hiscore_image/farming.gif" alt="Farming" /> <font color="#FF9900">'.parse(Farming).'</font><img src="http://runescape.rswildy.co.uk/AFprsfs/hiscore_image/slayer.gif" alt="Slayer" /> <font color="#FF9900">'.parse(Slayer).'</font> <br/><img src="http://runescape.rswildy.co.uk/AFprsfs/hiscore_image/crafting.gif" alt="Crafting" /> <font color="#FF9900">'.parse(Crafting).'</font><img src="http://runescape.rswildy.co.uk/AFprsfs/hiscore_image/hunter.gif" alt="Hunter" /> <font color="#FF9900">'.parse(Hunter).'</font><img src="http://runescape.rswildy.co.uk/AFprsfs/hiscore_image/mining.gif" alt="Mining" /> <font color="#FF9900">'.parse(Mining).'</font><img src="http://runescape.rswildy.co.uk/AFprsfs/hiscore_image/smithing.gif" alt="Smithing" /> <font color="#FF9900">'.parse(Smithing).'</font><img src="http://runescape.rswildy.co.uk/AFprsfs/hiscore_image/firemaking.gif" alt="Firemaking" /> <font color="#FF9900">'.parse(Firemaking).'</font><img src="http://runescape.rswildy.co.uk/AFprsfs/hiscore_image/woodcutting.gif" alt="Woodcutting" /> <font color="#FF9900">'.parse(Woodcutting).'</font><img src="http://runescape.rswildy.co.uk/AFprsfs/hiscore_image/runecraft.gif" alt="Runecraft" /> <font color="#FF9900">'.parse(Runecraft).'</font><img src="http://runescape.rswildy.co.uk/AFprsfs/hiscore_image/thieving.gif" alt="Theiving" /> <font color="#FF9900">'.parse(Thieving).'</font><img src="http://runescape.rswildy.co.uk/AFprsfs/hiscore_image/herblore.gif" alt="Herblore" /> <font color="#FF9900">'.parse(Herblore).'</font><img src="http://runescape.rswildy.co.uk/AFprsfs/hiscore_image/agility.gif" alt="Agility" /> <font color="#FF9900">'.parse(Agility).'</font><br /><font color="#FF9900"><b>Total Level:</b> '.parse(Overall).'</font>');?></center></td> </tr></table></form></body></html> Thanks, Low
  23. thanx, That really cleared things up.
  24. I need an image host script that is simple, All it needs to do is allow them to select an image file from they're computet and upload it to /images/ directory. It needs to be customizable with the picture width and height in pixels and only allow certain types like GIF, PNG, BMP, JPG, And any other popular image types, if anyone could find/write me a script for this then thanx. This may be in the wrong forum, But i can't think if its PHP, Javascript or HTML/XHTML.. Just move it if needed.
  25. rswildy

    help please

    How can i create a database like http://runescape.salmoneus.net/itemdb/index.php with a search function and easy customizable, If anyone has a pre-made code for this or will explain it would be a great help thanx.
×
×
  • Create New...