quote:
Originally posted by PHP error
Warning: Unexpected character in input: '\' (ASCII=92) state=1 in /home/theglas/public_html/guillaumelforum/halo2/index.php on line 33
Parse error: parse error, unexpected T_STRING in /home/theglas/public_html/guillaumelforum/halo2/index.php on line 33
code:
<?
$handle = fopen("http://www.bungie.net/Stats/PlayerStats.aspx?player=guyguyme2003", "rb");
$contents = '';
while (!feof($handle)) {
$contents .= fread($handle, 8192);
}
fclose($handle);
$match = InsideTags('<div class="ExpBar" style="width:50"><div class="ExpBarText" style="left:20">','</div></div>',$contents); // uses a regular expression and gets the stuff inbetween those two points and returns it
$rumble_pit = $match[1][0];
$team_skirmish = $match[1][1];
$head_to_head = $match[1][2];
$big_team_battle = $match[1][3];
$team_slayer = $match[1][4];
function InsideTags($tag1,$tag2,$html){ //function to grab text inbetween two points
$tag2 = str_replace('/', "\/" ,$tag2);
preg_match_all("/$tag1(.*)$tag2/i", $html, $match);
return $match;
}
header("Content-type: image/png");
$im = @imagecreate(100, 200)
or die("Cannot Initialize new GD image stream");
$background_color = imagecolorallocate($im, 255, 255, 255);
$text_color = imagecolorallocate($im, 0, 0, 0);
imagestring($im, 1, 5, 5, $rumble_pit \n $team_skirmish , $text_color);
imagepng($im);
imagedestroy($im);
?>
Did I do something wrong?