need some help with PHP

EV0LUTION

Beta member
Messages
4
i have been trying this for about 2 days

I'm trying to make an xbox gamercard generator i can get the stuff no problem but when i try to add the stuff to the an image it gives me about 5 lines of errors

this is my source code so far any help is needed

Code:
<html>
<head>
<title>The Online Nation </title>

<LINK REL="StyleSheet" HREF="themes/XD-Obstuse/style/style.css" TYPE="text/css"><body>
<center><font color="#ffffff">GamerTag:</font> <form action="./index2.php" method="post"><input name="tag" alt="Your Gamer Tag"><input type="Submit" value="Submit"></form></center>
<?




if (!($_GET['timeout'])) {
$timeout = 400;
}

if (!($_GET['tag'])) {

}
$tag = str_replace(" ","%20",$tag);

$file1 = file('./gamercard_cache.html');
$file = array_map('trim', $file1);

$abstand = time() - $file[0];

if ($abstand > $timeout || $tag != $file[1]) {
include('./snoopy.php');
$snoopy = new Snoopy; 
if($snoopy->fetch("http://gamercard.xbox.com/". $tag .".card")) 
$in = ($snoopy->results);

preg_match('#<h3 class="XbcGamertag(.+?)">#',$in, $gamertagstyle1); 
preg_match('#width="64" src="(.+?)" /></a>#',$in, $gamertile1);
preg_match('#XbcFRAR"><img src="(.+?)" /></span></p>#',$in, $gamerrep1);  
preg_match('#Gamerscore" src="(.+?)" />#',$in, $gamerscore_img1);  
preg_match_all('#<span class="XbcFRAR">(.+?)</span>#',$in, $gamer);
preg_match_all('#<div class="XbcgcGames">(.+?)</div>#',$in, $gamesa);

$gamerrep = "http://gamercard.xbox.com". $gamerrep1[1];
$gamerscore_img = "http://gamercard.xbox.com". $gamerscore_img1[1];
$gamerscore = $gamer[1][1];
$gamerzone = $gamer[1][2];
$gamerarchivements = $gamesa[1][0];
$gamerarchievements = $gamesa[1][0];

$cache_string = time() ."\n". $tag ."\n". $gamertagstyle1[1] ."\n". $gamertile1[1] ."\n". $gamerrep ."\n". $gamerscore ."\n". $gamerscore_img ."\n". $gamerzone ."\n". $gamerarchivements ."\n". $stat ;


$cache = fopen ("./gamercard_cache.html", "w");
fwrite($cache, $cache_string );
fclose($cache);

$gamertagstyle = $gamertagstyle1[1];
$gamertile = $gamertile1[1];
$gamertag = str_replace("%20"," ", $tag);

} else {


$tag = $file[1];
$gamertag = str_replace("%20"," ", $tag);
$gamertagstyle = $file[2];
$gamertile = $file[3];
$gamerrep = $file[4];
$gamerscore = $file[5];
$gamerscore_img = $file[6];
$gamerzone = $file[7];
$gamerarchivements = $file[8];
$gamerarchievements = $file[8];

}

echo " <center><font color=\"\"><b>GamerTag</b>: $gamertag<br> Gamer pic:<br><img src=\"$gamertile\"> <br>Code To Copy:<br><textarea name=\"textarea\" cols=\"40\" rows=\"3\">$gamertile</textarea><br><br> Recent Activities:<br>$gamerarchievements</font></center> ";

include ('./testing.php');

?> 
</body></html>
 
it'd help if you could either copy/paste the error message, or point us to the page where this is hosted so that we could see exactly where the error is...
 
ok the file is http://theonlinenation.com/dl/index2.php

and i added the following code

Code:
echo " <img src=\"$gamertag.test.png\" border=\"0\"> <br><br><center><b>GamerTag</b>: $gamertag<br> Gamer pic:<br><img src=\"$gamertile\"> <br>Code To Copy:<br><textarea name=\"textarea\" cols=\"40\" rows=\"3\">$gamertile</textarea><br><br> Recent Activities:<br>$gamerarchievements</font></center> ";


// create a 100*30 image
imagecreate("100", "30");
$im = imagecreatefrompng("./$gamercard.test.png");

// white background and blue text
$bg = imagecolorallocate($im, 255, 255, 255);
$textcolor = imagecolorallocate($im, 0, 0, 255);

// write the string at the top left
imagestring($im, 5, 0, 0, "$gamercard", $textcolor);

// output the image
imagepng($im);

?> 
</body></html>
 
I think the problem is that you don't have the GD extension installed on your webserver...

have been able to make anything in the past that has used graphic creation in this way?
 
well that explains the errors!

Umm... as for graphics generation... are you able to install GD, or get it installed... (it's free and easy to install).

it is possible to generate graphics in 'other ways', but it's not as easy as usings GD...

I think the best way that you can do this is to use flash with php... (A little unorthadox I know...).
the standard use of php and flash is to get flash files to call PHP files, however, you can make flash movies dependant on external data, (this is how they make flash graphs). so you can control things on a Pixel based thing... I'm not sure how you'd go about importing external pictures. perhaps this is something you could ask a 'flash person' about -I'm not all that hot on flash...

another choice is that you could have the pictures generated by GD on a different server, and then just included with regular HTML image tags...
 
Back
Top Bottom