I have been following a video tutorial on how to make an image upload website, but he hasn’t finished it yet and I went to get it done tonight.
index.php code:
[code=php]<html>
<form action=”upload.php” method=”post” enctype=”multipart/form-data”>
<input type=”file” name=”myfile”><p>
<input type=”submit” value=”Upload”>
</form>
</html>
upload.php code:
[code=php]<?php
// properties of the uploaded file
$name = $_FILES[“myfile”][“name”];
$type = $_FILES[“myfile”][“type”];
$size = $_FILES[“myfile”][“size”];
$temp = $_FILES[“myfile”][“tmp_name”];
$error = $_FILES[“myfile”][“error”];
if ($error > 0)
die(“Error uploading file! Code $error.”);
else
{
if($type = “video/avi”) //conditions for the file
{
die(“That format is not allowed”);
}
else
{
move_uploaded_file($temp,”uploaded/”.$name);
echo “Upload complete”;
}
}
?>
At the moment the file you upload goes into the uploaded folder, but it does not show the user who uploaded the file the image.
You can view a live example here:
[url]http://cure2boredom.x10hosting.com/SpeedyUpload/
Thanks for the help