zero-perfoliate
zero-perfoliate

Author Topic: Gaming Fansite Grab Info From Option, Put Into Variable  (Read 188 times)

Offline RuneStation

  • New PHP Members
  • Posts: 1
  • Karma: +0/-0
Gaming Fansite Grab Info From Option, Put Into Variable
« on: April 01, 2011, 05:22:37 PM »
Keep in mind, I'm a bit new to coding so if this is a stupid question, I'm sorry!

If you've ever heard of the online game, RuneScape, you know there is a highscore database.
I know how to access that database by the code below:
Code: [Select]
$name = $_POST['name'];
$filecontents = file_get_contents("http://hiscore.runescape.com/index_lite.ws?player=$name");
$stats = explode(',' , $filecontents);
$exp =  explode("\n", $stats[specificLevel]);
echo $exp[0];

and it posts the results (what it found on that specific page, line) like this:
Code: [Select]
<input type="text" name="nameLevel" value="<?php echo $exp[0?>" />

What I Need:
I want to grab a specific level, based on what they choose in

Code: [Select]
<select name="skill" onchange="calculateLevels()">
<option>Farming</option>
<option>Hunter</option>
<option>Firemaking</option>

(only 3 for example)

So I'd like to grab, for example, Hunter, and insert a specific number as a variable (to correspond that certain level from the online database webpage) and insert that specific variable into the code of
Code: [Select]
$exp =  explode("\n", $stats[specificLevel]);
If any of this made sense, please offer your help.
If you need anymore information, just ask :D.

Thanks!

 

zero-perfoliate