title: Add a warning message: "Image uploaded successfully"
body: <p>Can you tell me how to add a message, when the image is loaded correctly?</p>
  
  <p>(If you have suggestions on the code I am grateful)</p>
  
  <pre><code>&lt;?
  function upload()
  {
    $result = false;
    $alwidth = 1150;            // maximum allowed width, in pixels
    $alheight = 1150;           // maximum allowed height, in pixels
    $max_size = 300000;          // maximum file size, in KiloBytes
    $allowtype = array('bmp', 'gif', 'jpg', 'jpe', 'png');        // allowed extensions
    $immagine = '';
    $size = 0;
    $type = '';
    $nome = '';
  
   //check if its allowed or not
   $allowtype = array(".jpg",".jpeg",".gif",".png"); 
   if (!(in_array($file_ext, $allowtype))) {
      die ('&lt;h1 class=\"cover-heading\"&gt;Not allowed extension.&lt;br /&gt;Please upload images only&lt;/h1&gt;');
   }
  
      $type = $_FILES['file']['type'];
      $nome = $_FILES['file']['name'];
      $immagine = @file_get_contents($_FILES['file']['tmp_name']);
      $immagine = addslashes ($immagine);
      @include 'config.php';
      $sql = "INSERT INTO immagini (nome, size, type, immagine) VALUES ('$nome','$size','$type','$immagine')";
      $result = @mysql_query ($sql) or die (mysql_error());
      return true;
  
  }
  
  ?&gt;
  </code></pre>