Hello.
I want to create a form with one field of type input and the other as submit.
When typing something in the input field and clicking the submit button an image will be generated through the PHP GD library. But the problem is, I do not know how I can do this, I've researched in several forums and read several articles on, but I can not do it at all.
HTML CODE
<form action="" method="get">
<input name="nome" type="text" placeholder="Texto a ser Gerado" size="100"/>
<input type="submit" value="Criar Imagem"/>
PHP CODE
<?php
//Define o header como sendo de imagem
header("Content-type: image/png");
// Definições
$preto = imagecolorallocate($i, 0,0,0); #Cor do texto; "cor preta"
$texto = "Exemplo"; #Texto a ser escrito
$fonte = "trebuc.ttf"; #Fonte que será utilizada
//Escreve na imagem
imagettftext($i, 32, 0, 160,360, $preto, $fonte, $texto);
//Gera a imagem na tela
imagejpeg($i);
//Destroi a imagem para liberar memória
imagedestroy($i);
? >
Please give me a solution to my problem, how can I resolve this?
Thank you very much in advance.