i'm trying to save text in a form to a session, and use the session to convert it to a .png filebut it doesnt seem to work, and i dont know where its messing up.
this is the form page:
and the link: hereCode:<html> <form method="POST" action="http://akwardsaw.hostoi.com/createpic.php"> <input type="text" name="text" value="text"> <input type="submit" value="Change"> </form> </html>
here is the file to convert that text to a .png file:
hereCode:<?php $_SESSION['text']=$_POST['text']; session_start(); header("Content-type: image/png"); function create($text){ $im = imagecreate(100, 30); $bg = imagecolorallocate($im, 255, 255, 255); $textcolor = imagecolorallocate($im, 0, 0, 255); imagestring($im, 5, 0, 0, $text, $textcolor); imagepng($im); imagedestroy($im); } if(isset($_SESSION['text'])) create($_SESSION['text']); else { $_SESSION['text']="wat"; create($_SESSION['text']); } ?>
making the pic works, but it doesnt save the POST text from the form into a session![]()





but it doesnt seem to work, and i dont know where its messing up.
Reply With Quote

