<html>
<head>
<meta http-equiv="content-type" content="text/html; charset=UTF-8">
</head>
<body>
<p>I tried working on the second half of my website (downloading)
and the uploading part stopped working. Can anyone see any reason
for this ? I added the echo statements to the file, but none
display anything.<br>
</p>
<p><u>HTML file</u></p>
<p><form action="upload.php" method="post"
enctype="multipart/form-data"><br>
<input type="file" name="fileToUpload"
id="fileToUpload"><br>
<input type="submit" value="Upload music file"
name="submit"><br>
</form><br>
</p>
<p><u>upload.php</u></p>
<p><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>
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>