Hallo so this is what I have:
test.php
<form action="index.php" method="post">
<input type="text" name="nick">
<input type="submit" name="test">
</form>
index.php
<?php
if(isset($_POST['test'])) {
$bg = imagecreatefrompng('img/sygn/1.png') or die("t");
$font = "others/rte.ttf";
$blackColor = imagecolorallocate($bg, 47, 53, 62);
$diamondColor = imagecolorallocate($bg, 140, 244, 226);
$emeraldColor = imagecolorallocate($bg, 92, 244, 149);
$goldCollor = imagecolorallocate($bg, 234, 238, 87);
header("Content-type: image/png");
imagettftext($bg, 29, 0, 5, 33, $blackColor, $font, 'Username');
imagettftext($bg, 17, 0, 360, 83, $goldCollor, $font, '20');
imagettftext($bg, 17, 0, 360, 43, $emeraldColor, $font, '20');
imagettftext($bg, 28, 0, 50, 125, $diamondColor, $font, '400');
imagepng($bg);
imagepng($bg, "users/image.png");
imagedestroy($bg);
}
?>
I would like to display the image after clicking on the button. But it doesn't work, I don't get any image only the blank side. If I remove if statement it works correctly. Also if I Add:
echo '<input type="text">'
In the first line, image generator wont work as well. Same with for example:
include form.php
This is what I get:
http://screenshot.net/pjg6du1