Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <?php
- if(isset($_POST['nome']) && isset($_POST['cognome']) && isset($_POST['eta']) && isset($_POST['luogo']) && isset($_POST['sito']) && isset($_POST['sesso'])) {
- $img = imagecreatefrompng('back.png');
- $color = imagecolorallocate($img, 0, 0, 0);
- putenv('GDFONTPATH=' . realpath('.'));
- $font = 'OpenSans-Light.ttf';
- if(!imagettftext($img, 30, 0, 210, 165, $color, $font, $_POST['nome'])) die("Errore nel generare l'immagine");
- if(!imagettftext($img, 30, 0, 465, 165, $color, $font, $_POST['cognome'])) die("Errore nel generare l'immagine");
- if(!imagettftext($img, 30, 0, 210, 220, $color, $font, $_POST['eta'])) die("Errore nel generare l'immagine");
- if(!imagettftext($img, 30, 0, 465, 220, $color, $font, $_POST['luogo'])) die("Errore nel generare l'immagine");
- if(!imagettftext($img, 30, 0, 210, 275, $color, $font, $_POST['sito'])) die("Errore nel generare l'immagine");
- if(!imagettftext($img, 30, 0, 465, 275, $color, $font, $_POST['sesso'])) die("Errore nel generare l'immagine");
- header('Content-type: image/png');
- imagepng($img);
- imagedestroy($img);
- }
- else echo "Dati mancanti, inserisci tutti i dati per creare l'immagine";
- ?>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement