Author: (---.mia.bellsouth.net)
Date: 10-21-03 13:17
Hello,
I have an upload script on my site which I found on the internet a while back. I'd like to know how to alter it to fix some bugs.
It works with two files, an HTML file with a form, and a php file which the other file posts to. The PHP file is as follows:
<head>
<title>pheterson.com - upload script</title>
<META HTTP-EQUIV=Refresh CONTENT="5; URL=http://www.pheterson.com/upload/">
</head>
<?
/*upload.php*/
if ($img1_name != "") {
@copy("$img1", "/home/pheterso/www/upload/$img1_name")
or die("No copy!");
} else {
die("No input file!");
}
?>
<b>Your file has been uploaded successfully. Please wait to continue.<br><br>
Or... If you're a lazy ass, <a href="http://www.pheterson.com/upload/">click here</a>.
The modifications I would like to make to this file are as follows:
1) Not allow index.html, index.htm, index.php to be uploaded.
2) Not allow overwriting of files.
Any help at all is appreciated.
Thanks,
Eric
|
|