textbox naar php

Status
Niet open voor verdere reacties.

Remi1995

Gebruiker
Lid geworden
31 jul 2009
Berichten
291
Opgelost.
_____________________________

Hallo.


Ik heb dit php script op internet gevonden;
PHP:
<?php
  $rsn=$_GET["rsn"];
  $stats=array("Overall","Attack","Defence","Strength","Hitpoints","Ranged","Prayer","Magic","Cooking","Woodcutting","Fletching","Fishing","Firemaking","Crafting","Smithing","Mining","Herblore","Agility","Thieving","Slayer","Farming","Runecrafting","Hunter","Construction","Summoning","Duel Tournament","Bounty Hunters","Bounty Hunters Rougue","Fist Of Guthix","Mobilising Armies");
  $url="http://hiscore.runescape.com/index_lite.ws?player=".$rsn;
  $data=explode(chr(10),file_get_contents($url));
  $a="0";
  echo "<pre>Showing Stats for: ".$rsn."</br>";
  foreach ($data as &$value) {
    if ($a<29) {
      $value=str_replace(","," ",$value);
      echo $stats[$a].": ".str_replace("-1 -1","Not Ranked",str_replace("-1 -1 -1","Not Ranked",$value))."</br>";
    }
    $a++;
  }
  echo "Done</pre>";
?>
maar er moet nog iets ingevult worden (rsn) hoe maak ik zo'n textbox zodat die ervoor zorg dat php de naam weet.
En een button die er voor zorg dat php begint met wat die moet doen (informatie krijgen van een site).



Vriendelijke groeten, Remi1995
 
Laatst bewerkt:
Zoiets:

PHP:
if ( $_SERVER['REQUEST_METHOD'] == 'POST' ):
 $rsn=$_POST["rsn"];
  $stats=array("Overall","Attack","Defence","Strength","Hitpoints","Ranged","Prayer","Magic","Cooking","Woodcutting","Fletching","Fishing","Firemaking","Crafting","Smithing","Mining","Herblore","Agility","Thieving","Slayer","Farming","Runecrafting","Hunter","Construction","Summoning","Duel Tournament","Bounty Hunters","Bounty Hunters Rougue","Fist Of Guthix","Mobilising Armies");
  $url="http://hiscore.runescape.com/index_lite.ws?player=".$rsn;
  $data=explode(chr(10),file_get_contents($url));
  $a="0";
  echo "<pre>Showing Stats for: ".$rsn."</br>";
  foreach ($data as &$value) {
    if ($a<29) {
      $value=str_replace(","," ",$value);
      echo $stats[$a].": ".str_replace("-1 -1","Not Ranked",str_replace("-1 -1 -1","Not Ranked",$value))."</br>";
    }
    $a++;
  }
  echo "Done</pre>";

else :
  ?>
<form action="" method="post">
<input type="text" name="rsn" value="" />
<input type="submit" value="Inzenden" />
</form>

<?php
endif;
 
Zoiets:

PHP:
if ( $_SERVER['REQUEST_METHOD'] == 'POST' ):
 $rsn=$_POST["rsn"];
  $stats=array("Overall","Attack","Defence","Strength","Hitpoints","Ranged","Prayer","Magic","Cooking","Woodcutting","Fletching","Fishing","Firemaking","Crafting","Smithing","Mining","Herblore","Agility","Thieving","Slayer","Farming","Runecrafting","Hunter","Construction","Summoning","Duel Tournament","Bounty Hunters","Bounty Hunters Rougue","Fist Of Guthix","Mobilising Armies");
  $url="http://hiscore.runescape.com/index_lite.ws?player=".$rsn;
  $data=explode(chr(10),file_get_contents($url));
  $a="0";
  echo "<pre>Showing Stats for: ".$rsn."</br>";
  foreach ($data as &$value) {
    if ($a<29) {
      $value=str_replace(","," ",$value);
      echo $stats[$a].": ".str_replace("-1 -1","Not Ranked",str_replace("-1 -1 -1","Not Ranked",$value))."</br>";
    }
    $a++;
  }
  echo "Done</pre>";

else :
  ?>
<form action="" method="post">
<input type="text" name="rsn" value="" />
<input type="submit" value="Inzenden" />
</form>

<?php
endif;

Het werkt, dank u wel.
 
Status
Niet open voor verdere reacties.
Terug
Bovenaan Onderaan