View Single Post
Old 11-05-2009, 02:24 PM   #126 (permalink)
LeftRight
The Visitor
 
Join Date: Nov 2009
Posts: 1
Thanks: 0
LeftRight is on a distinguished road
Default

hey all, i have the following code, but it seems like it doesn't fetch the data from the wow armory. Anyone can see what it is?

thanks.

Code:
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
</head>
<body>
1
<?php
	$url = 'http://eu.wowarmory.com/guild-info.xml?r=Frostmane&gn=Our+Sick+Story&p=1';
    $ch = curl_init();
    curl_setopt ($ch, CURLOPT_URL, $url);
    curl_setopt ($ch, CURLOPT_RETURNTRANSFER, true);
    curl_setopt ($ch, CURLOPT_USERAGENT,  "Mozilla/5.0 (Windows; U; Windows NT 5.1; en-US; rv:1.8.1.1) Gecko/20061204 Firefox/2.0.0.1");
	$rosterxml = curl_exec($ch);  
	if($rosterxml != ""){
		$xml = new SimpleXMLElement($rosterxml);
		foreach ($xml->guildInfo->guild->members->children() as $char) {
			echo '<b>Name:</b> ' . $char['name'] . ' ';
			echo '<b>Class:</b> ' . $char['class'] . ' ';
			echo '<b>Level:</b> ' . $char['level'] . ' <br>';
		} 
	}
	else{
		echo 'empty roster';
	}
?>
2
</body>
</html>
LeftRight is offline  
Reply With Quote