hmm, using a form to save to a session, then convert to a .png?
i'm trying to save text in a form to a session, and use the session to convert it to a .png file :) but it doesnt seem to work, and i dont know where its messing up.
this is the form page:
Code:
<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>
and the link: here
here is the file to convert that text to a .png file:
Code:
<?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']);
}
?>
here
making the pic works, but it doesnt save the POST text from the form into a session :(