hello :)
i have managed to get my php to work as in, an uploader user page
1) upload.php ||| amount of files to be uploaded
[php]
<html>
<head>
<title>Upload_Amount</title>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
</head>
<body>
<form name="form1" method="post" action="upload_get.php">
<p>Enter the amount of boxes you will need below. Max = 9.</p>
<p>
<input name="uploadNeed" type="text" id="uploadNeed" maxlength="1">
</p>
<p>
<input type="submit" name="Submit" value="Next">
</p>
</form>
</body>
</html>
[/php]
2) upload_get.php ||| browse and upload files
[php]
<html>
<head>
<title>Upload_Browse</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="process.php">
<p>
<?
$uploadNeed = $_POST['uploadNeed'];
for($x=0;$x<$uploadNeed;$x++){
?>
<input name="uploadFile<? echo $x;?>" type="file" id="uploadFile<? echo $x;?>">
</p>
<?
}
?>
<p><input name="uploadNeed" type="hidden" value="<? echo $uploadNeed;?>">
<input type="submit" name="Submit" value="Upload">
</p>
</form>
</body>
</html>
[/php]
3) process.php ||| the uploader
[php]
<?
$uploadNeed = $_POST['uploadNeed'];
for($x=0;$x<$uploadNeed;$x++){
$file_name = $_FILES['uploadFile'. $x]['name'];
$file_name = stripslashes($file_name);
$file_name = str_replace("'","",$file_name);
$path = 'uploads/';
$copy = copy($_FILES['uploadFile'. $x]['tmp_name'],$path.$file_name);
if($copy){
echo"<font color=#009999 face=verdana size=10>$file_name | uploaded sucessfully!<br>";
}else{
echo "$file_name | could not be uploaded!<br></font>";
}
}
?>
[/php]
i don't know how to implement a process indicator though :(
i have found a few sites that output the file upload process
but they either use flash or javascript...
http://pdoru.from.ro/
http://swfupload.mammon.se/
i only want a simple message to display after the "upload" input button is clicked
i had been studying the php code and the "action" command
on the input line directs the subsequent action (lol) of the
button as in....
[php]
<form name="form1" method="post" action="upload_get.php">
[/php]
this opens the page "uplaod_get.php"
[php]
<form name="form1" enctype="multipart/form-data" method="post" action="process.php">
[/php]
this then runs the process.php data
i would like an intermittent page/code in between the upload_get.php and the process.php to display "uploading in process, please wait....." and also be able to read/process the process.php data
this may be simple, may be hard but i can't do it :(
any help with this?
thanks
sophia