Advertisement
Guest User

Untitled

a guest
Feb 17th, 2015
224
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
PHP 1.14 KB | None | 0 0
  1. <?php
  2. if(isset($_POST['nome']) && isset($_POST['cognome']) && isset($_POST['eta']) && isset($_POST['luogo']) && isset($_POST['sito']) && isset($_POST['sesso'])) {
  3.     $img = imagecreatefrompng('back.png');
  4.     $color = imagecolorallocate($img, 0, 0, 0);
  5.     putenv('GDFONTPATH=' . realpath('.'));
  6.     $font = 'OpenSans-Light.ttf';
  7.     if(!imagettftext($img, 30, 0, 210, 165, $color, $font, $_POST['nome'])) die("Errore nel generare l'immagine");
  8.     if(!imagettftext($img, 30, 0, 465, 165, $color, $font, $_POST['cognome'])) die("Errore nel generare l'immagine");
  9.     if(!imagettftext($img, 30, 0, 210, 220, $color, $font, $_POST['eta'])) die("Errore nel generare l'immagine");
  10.     if(!imagettftext($img, 30, 0, 465, 220, $color, $font, $_POST['luogo'])) die("Errore nel generare l'immagine");
  11.     if(!imagettftext($img, 30, 0, 210, 275, $color, $font, $_POST['sito'])) die("Errore nel generare l'immagine");
  12.     if(!imagettftext($img, 30, 0, 465, 275, $color, $font, $_POST['sesso'])) die("Errore nel generare l'immagine");
  13.     header('Content-type: image/png');
  14.     imagepng($img);
  15.     imagedestroy($img);
  16. }
  17. else echo "Dati mancanti, inserisci tutti i dati per creare l'immagine";
  18.  
  19. ?>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement