dragonqueen Posted April 1, 2009 Share Posted April 1, 2009 Test page: http://tlb.plesk.freepgs.com/siggyscript.html I'm trying to create sort of a siggy generator where the user enters the text to be added to an image then they can save the finished image. Right now when you submit the form it says "the image siggyscript.php cannot be displayed. Why is is using the script as the image? Here's my html page: <html> <head> <title>Sample Siggy Script!</title> </head> <body> <div align="center"> <p><img src="http://tlb.plesk.freepgs.com/Tag4Marcy.gif" width="113" height="117"></p> <form method="post" action="/siggyscript.php"> <p> <input name="name" type="text" id="name" value="Enter Name" size="14" maxlength="10"> </p> <p> <input name="submit" type="submit" id="submit" value="Submit"> </p> </form> </div> </body> </html> Here's my php: <html> <head> <title>Your tag is ready!</title> </head> <body> <?php header('Content-Type: image/gif'); //load the image to be written on $im = @imagecreatefromgif("Tag4Marcy.gif"); //checking for image if(!$im) { die("Could not load image!"); } // The text to draw $text = $_POST['name']; $font = 'arial.ttf'; $black = imagecolorallocate($im, 0, 0, 0); // Add the text imagettftext($im, 20, 0, 10, 20, $black, $font, $text); imagegif($im); imagedestroy($im); ?> <?php error_reporting(E_ALL); ?> </body> </html> Link to comment https://forums.phpfreaks.com/topic/152021-solved-image-display-error/ Share on other sites More sharing options...
Maq Posted April 1, 2009 Share Posted April 1, 2009 Change this line to: </pre> <form method="post" action="siggyscript.php">< Link to comment https://forums.phpfreaks.com/topic/152021-solved-image-display-error/#findComment-798376 Share on other sites More sharing options...
dragonqueen Posted April 1, 2009 Author Share Posted April 1, 2009 Still the same error. ??? Link to comment https://forums.phpfreaks.com/topic/152021-solved-image-display-error/#findComment-798378 Share on other sites More sharing options...
dragonqueen Posted April 2, 2009 Author Share Posted April 2, 2009 OK, the problem was 2 spaces before the opening php tag. Problem solved. Link to comment https://forums.phpfreaks.com/topic/152021-solved-image-display-error/#findComment-799852 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.