<html>
  <head>

    <meta http-equiv="content-type" content="text/html; charset=UTF-8">
  </head>
  <body>
    <p>I cannot understand why my site uploads a file then stops
      working.  Is something wrong with the HTML ?</p>
    <p><u>HTML</u></p>
    <p><br>
      <form action="upload.php" method="post"
      enctype="multipart/form-data"><br>
          <input type="file" name="fileToUpload" id="fileToUpload"
      multiple><br>
          <input type="submit" value="Upload music file"
      name="submit"><br>
      </form><br>
    </p>
    <p><u>upload.php</u></p>
    <p><!doctype html><br>
      <br>
      <html><br>
      <body><br>
      <br>
      <br>
      <?php<br>
      $target_dir = "Music/";<br>
      $target_file = $target_dir .
      basename($_FILES["fileToUpload"]["name"]);<br>
      $uploadOk = 1;<br>
      $audioFileType =
      strtolower(pathinfo($target_file,PATHINFO_EXTENSION));<br>
      <br>
      // Check if file already exists<br>
      echo "First if";<br>
      if (file_exists($target_file)) {<br>
          echo "Sorry, file already exists.";<br>
          $uploadOk = 0;<br>
      } <br>
      echo "Second if";<br>
      // Allow certain file formats<br>
      if (($audioFileType != "mp3") && ($audioFileType !=
      "ogg"))  {<br>
          echo $audioFileType . <br> . "Sorry, only MP3 and OGG
      files are allowed.");<br>
          $uploadOk = 0;<br>
      } <br>
      // Check if $uploadOk is set to 0 by an error<br>
      echo "Third if";<br>
      if ($uploadOk == 0) {<br>
          echo "Sorry, your file was not uploaded."; <br>
      // if everything is ok, try to upload file<br>
       else {<br>
          "Fourth if";<br>
          if (move_uploaded_file($_FILES ["fileToUpload"]["tmp_name"],
      $target_file)) {<br>
              echo "The file ". basename(
      $_FILES["filndow.alerteToUpload"]["name"]). " has been uploaded.";
      } <br>
          else {<br>
              echo "Sorry, there was an error uploading your file." }<br>
      <br>
      ?><br>
      <br>
      </body><br>
      </html><br>
      <br>
    </p>
  </body>
</html>