well no duh, with an upload script there is always the mention of security, but considering the only thing they can upload is virus's that effect others if they get someone to download it, otherwise its only php scripts you will have to worry about..
Even still add a downloader for the files, I worked on a few uploader scripts myself and they are not hard to create look for tutorials and other info on the web php.net is a big help when it comes to uploading files and editing files.
Little edit to your first script, when file is uploaded successfully, this will return the url in a text box, just like imageshack.us does.
hope you don't mind that I did a tiny bit of editing RageD.
PHP:
<?php
/* Upload Script by RageD
© 2006 RageD. All Rights Reserved.
Filename: upload.php
File Info: Created by RageD. Upload script for anyone who needs it
File Function: Uploads Files into a hidden directory (In this case by default '/uploads'
File Notes: Make sure your directory (whatever you make '$upload_dir' equal) is CHMODDED to 0777
Added Notes: You can place this file within a directory such as /public_html/uploads/upload_script and still have it upload files to /public_html/uploads (make sure it is CHMODDED 0777) all you have to do to do this is something like this: $upload_dir = "../"; or another directory within /public_html/uploads (directory qwerty for example) $upload_dir = "../qwerty";
*/
// Use this to define your upload directory!
$upload_dir = "uploads";
//edit this so the link displays correcty, no trailing slashes!
$site = "http://www.xiaohost.com";
if(!$upload){
?>
<html>
<head>
<title>Upload Files</title>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
</head>
<body>
<form name="form1" method="post" action="?upload=step2">
<p>Enter the amount of boxes you will need below. Max = 99</p>
<p>
<input name="uploadNeed" type="text" id="uploadNeed" maxlength="2">
</p>
<p>
<input type="submit" name="Submit" value="Submit">
</p>
</form>
</body>
</html>
<?php
}
if($upload){
if($upload == "step2"){ ?>
<html>
<head>
<title>Upload Files</title>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
</head>
<body>
<form name="form1" enctype="multipart/form-data" method="post" action="?upload=process">
<p>
<?
// start of dynamic form
$uploadNeed = $_POST['uploadNeed'];
for($x=0;$x<$uploadNeed;$x++){
?>
<input name="uploadFile<? echo $x;?>" type="file" id="uploadFile<? echo $x;?>">
</p>
<?
// end of for loop
}
?>
<p><input name="uploadNeed" type="hidden" value="<? echo $uploadNeed;?>">
<input type="submit" name="Submit" value="Submit">
</p>
</form>
</body>
</html>
<?php }
if($upload == "process"){
$uploadNeed = $_POST['uploadNeed'];
// start for loop
for($x=0;$x<$uploadNeed;$x++){
$file_name = $_FILES['uploadFile'. $x]['name'];
$show_file = $_FILES['uploadFile'. $x]['name'];
// strip file_name of slashes
$file_name = stripslashes("$upload_dir/$file_name");
$file_name = str_replace("'","",$file_name);
$copy = copy($_FILES['uploadFile'. $x]['tmp_name'],$file_name);
// check if successfully copied
if($copy){
echo "$show_file | uploaded sucessfully!<br>";
echo "Link To File: <textarea rows='1' name='select' cols='140'>http://www.".$site."/".$upload_dir."/".$file_name."</textarea></p>";
}else{
echo "$show_file | could not be uploaded!<br>";
}
} // end of loop
}
}
?>