Fox_USA Posted June 9, 2007 Share Posted June 9, 2007 well the problem is i will not let me use imagecreatefrompng tred othe functions as well I am using php 5.2.1 Apache version 1.3.37 (Unix) function sig() { header("Content-type: image/png"); //this lines tells the browers that the PHP file is a PNG image $user = $_GET["user"]; //username to display on the signature $img = imagecreatefrompng("image/image.png"); $black = imagecolorallocate($img,0,0,0); //makes the background color black $lime = imagecolorallocate($img,50,205,50); //the color white (used for text) //if you want to change the text or backgroud color then re-enter the RGB values imagestring($img,1,1,0,"Chao Online",$lime); //draws the text "Name of your game" (the first number is the size of the text, the second is the x position of the text, the third is the y position of the text) $statsq = mysql_query("SELECT * FROM users WHERE username='$user'") or die("ERROR"); //mysql query to get * (meaning anyting) from the table where the username is $user while ($stats = mysql_fetch_assoc($statsq)) { imagestring($img,1,1,10,"Username: $stats[username]",$lime); //draws the players username imagestring($img,1,1,20,"Score: $stats[score]",$lime); //draws the players score if ($stats[online]) { imagestring($img,1,1,30,"Status: Online",$lime); } else { imagestring($img,1,1,30,"Status: Offline",$lime); } } imagepng($img); //draws the whole image as a PNG imagedestroy($img); //destroys the whole image } Link to comment https://forums.phpfreaks.com/topic/54888-solved-imagecreatefrompng-help/ Share on other sites More sharing options...
fert Posted June 9, 2007 Share Posted June 9, 2007 do you have gd installed? Link to comment https://forums.phpfreaks.com/topic/54888-solved-imagecreatefrompng-help/#findComment-271445 Share on other sites More sharing options...
Fox_USA Posted June 9, 2007 Author Share Posted June 9, 2007 dont know what that is? used imagecreate functions before Link to comment https://forums.phpfreaks.com/topic/54888-solved-imagecreatefrompng-help/#findComment-271447 Share on other sites More sharing options...
Fox_USA Posted June 9, 2007 Author Share Posted June 9, 2007 yes i do Link to comment https://forums.phpfreaks.com/topic/54888-solved-imagecreatefrompng-help/#findComment-271456 Share on other sites More sharing options...
tippy_102 Posted June 9, 2007 Share Posted June 9, 2007 How are you calling that function? Link to comment https://forums.phpfreaks.com/topic/54888-solved-imagecreatefrompng-help/#findComment-271478 Share on other sites More sharing options...
Fox_USA Posted June 9, 2007 Author Share Posted June 9, 2007 case "sig": sig(); break; //displays a signature Link to comment https://forums.phpfreaks.com/topic/54888-solved-imagecreatefrompng-help/#findComment-271587 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.