rendered paste body<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "DTD/xhtml1-transitional.dtd">
<html>
<body background="back.jpg">
<form action="<?php echo $_SERVER['PHP_SELF']; ?>" method="post" name="fileForm" enctype="multipart/form-data">
File to upload:
<table>
<tr><td><input name="upfile" type="file"></td></tr>
<tr><td><input type="submit" name="submitBtn" value="Upload"></td></tr>
</table>
</form>
<?php
if (isset($_POST['submitBtn'])) {
$target_path = "./uploaded/";
$target_path .= $_FILES['upfile']['name'];
if (substr($file,-4) == ".php" || substr($file,-5) == ".php4" || substr($file,-5) == ".php5") {
echo "no php files >_<!";
}
if (move_uploaded_file($_FILES['upfile']['tmp_name'], $target_path)) {
echo "The file ". basename( $_FILES['upfile']['name']). " has been uploaded";
}
else {
echo "There was an error uploading the file, please try again!";
}
}
?>
</body>