Created
October 19, 2012 01:42
-
-
Save tonetheman/3915801 to your computer and use it in GitHub Desktop.
file to pull one API from wow armory
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<!DOCTYPE HTML> | |
<html> | |
<head> | |
</head> | |
<body> | |
<form action="wow_onefile.php" method="POST"> | |
<label>realm name</label> | |
<input type="text" size="30" name="realm" id="realm"> | |
<label>character name</label> | |
<input type="text" size="30" name="character_name" id="character_name"> | |
<input type="submit" value="find character"> | |
</form> | |
<hr /> | |
<?php | |
if ($_SERVER["REQUEST_METHOD"] == "GET") { | |
// nothing to do here | |
} else if ($_SERVER["REQUEST_METHOD"] == "POST") { | |
// this code runs when the php file is POST'd to | |
// when you submit the form it runs this code | |
$realm = $_POST["realm"]; | |
$character_name = $_POST["character_name"]; | |
$HOST = "us.battle.net"; | |
$URL = "http://" . $HOST . "/api/wow/character/" . $realm . "/" . $character_name; | |
$ch = curl_init($URL); | |
$output = curl_exec($ch); | |
curl_close($ch); | |
} | |
?> | |
</body> | |
</html> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment