I have this little problem with my script since I'm able to output my image and "save it as" locally but I cannot do it when I try with the document uploaded to my server, what I need is that once I click submit the browser alerts me about what I want to do with the image, save it or open it, this is my script:
<?php $nombre=$_POST['nombre'];
    //Set the Content Type
header('Content-type: image/png'); 
    // Create Image From Existing File
    $jpg_image = imagecreatefromjpeg('fabian.jpg');
        // get image dimensions
 list($img_width, $img_height,,) = getimagesize("fabian.jpg");
    // Allocate A Color For The Text
    $white = imagecolorallocate($jpg_image, 255, 255, 255);
    // Set Path to Font File
    $font_path = '/fabian.ttf';
    // Set Text to Be Printed On Image
    $text =strtoupper($nombre);
    // Print Text On Image
    //imagettftext($jpg_image, 75, 0, 50, 400, $white, $font_path, $text);
  // find font-size for $txt_width = 80% of $img_width...
  $font_size = 1; 
  $txt_max_width = intval(0.8 * $img_width);    
  do {
  $font_size++;
  $p = imagettfbbox($font_size,0,$font_path,$text);
  $txt_width=$p[2]-$p[0];
  // $txt_height=$p[1]-$p[7]; // just in case you need it
 } while ($txt_width <= $txt_max_width);
  // now center text...
 $y = $img_height * 0.9 ;// baseline of text at 90% of $img_height
  $x = ($img_width - $txt_width) / 2;
  imagettftext($jpg_image, $font_size, 0, $x, $y, $white, $font_path, $text);
    // Send Image to Browser and Save
 imagepng($jpg_image);
 header("Content-Disposition: attachment; filename=snivel.png");
// Clear Memory
    imagedestroy($jpg_image);
   ?>
This sends the image to the browser as draw.php but I want it to be saved as snivel.png when the browser prompts me to save the file, this works only locally but not in my server.
 
    