GD / PHP Add text by form / Transparent Background

0
<?php
    $image = imagecreatetruecolor(100, 100);

    //Fundo Transparente
    imagealphablending($image, false);
    $transparency = imagecolorallocatealpha($image, 0, 0, 0, 127);
    imagefill($image, 0, 0, $transparency);
    imagesavealpha($image, true);

    //Aproveitando
    $black = imagecolorallocate($image, 255, 174, 0);
    imagefilledrectangle($image, 25, 25, 75, 75, $black);

    header('Content-Type: image/png');
    imagepng($image);
?>

I want to add a form with only one input field, when I click on the submit button, generate a transparent background image with the content you typed in the input field.

Can anyone help me do that?

    
asked by anonymous 01.08.2017 / 05:57

1 answer

0

Here's an example:

<form action="proccessImage.php" method="post">
    Input: <input type="text" name="input1"><br>
    <input type="submit">
</form>

When you click the button, a request will be made to the proccessImage.php file, where you can then add your code to process the image

You can also get the value of Input by doing the following:

$input1 = $_POST['input1'];
    
01.08.2017 / 14:12