<?
if (!$func) {
$func = "one";
}
switch ($func) {
case one:
echo "<form method=\"post\" enctype=\"multipart/form-data\" action=\"upload.php\">";
echo "<input type=\"file\" name=\"uploadedfile\" size=\"30\">";
echo "<input type=\"hidden\" name=\"max_file_size\" value=\"100000\">";
echo "<input type=\"hidden\" name=\"func\" value=\"two\">";
echo "<input type=\"submit\" value=\"UPLOAD\">";
break;
case two:
if($uploadedfile<>"none") {
if(!copy($uploadedfile,"files/$uploadedfile_name")) {
print("Sorry Dude, Your File failt to upload.<br>");
print("Either your file doesn't exist or it was too large.");
print("Please use your back button and try again.");
}
else {
print("Thanks, your file has been uploaded.");
}
}
break;
}
?>