html code:
<form enctype="multipart/form-data" action="upload_file.php"
method="POST">
<p> </p>
<p>Browse for file to upload: <br>
<input name="file" type="file" id="file" size="80"> <br>
<input type="submit" id="u_button" name="u_botton" value="Upload the File">
</p>
</form>
php code:
<?php
$file_result = "";
if ($_FILES["file"]["error"] > 0)
{
$_file_result .= "No File Upload or Invalid File";
$_file_result .= "Error Code: " . $_FILES["file"]["error"] . "<br>";
} else {
$file_result .=
"Upload: " . $_FILES["file"]["name"] . "<br>" .
"Type: " . $_FILES["file"]["type"] . "<br>" .
"Size: " . ($_FILES["file"]["size"] / 1024) . "Kb<br>" .
"Temp file: " . $_FILES["file"]["tmp_name"] . "<br>" .
move_uploaded_file($_FILES["file"]["tmp_name"],
"" . $_FILES["file"]["name"]);
$file_result .= "File Upload Successful !";
}
print " Now just go to www.example.com/ the name of the thing you uploaded "
?>
I am trying to get information from an html form, I am allowing people to upload to my server and I am trying to get the name of the file they uploaded
How do I do that?