I'll paste the 3 php files and then, if possible, I'd like someone to show me how/where I can specify a location to upload the files to.
Here we go:
Index.php
PHP Code:
<html>
<head>
<title>PHP Uploader</title>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
<style type="text/css">
.text1 {font-family: Arial, Helvetica, sans-serif;font-size: 12px;color: White;text-align : left;}
.text2 {font-family: Arial, Helvetica, sans-serif;font-size: 12px;color: Silver;text-align : left;}
.titre1 {font-family: Arial, Helvetica, sans-serif;font-size: 12px;font-weight: bold;color: #FFFFFF;}
.titre2 {font-family: Arial, Helvetica, sans-serif;font-size: 12px;font-weight: bold;color: #cccccc;}
</style>
</head>
<body bgcolor="#525A73">
[img]header.gif[/img]
<table width="500" border="0" cellspacing="0" cellpadding="0" align="center">
<tr>
<td class="text1">
<form name="form1" method="post" action="uploadForm2.php">
Enter the number of uploads. Max is 9.</p>
<input name="uploadNeed" type="text" id="uploadNeed" maxlength="1">
</p>
<input type="submit" name="Button1" value="Ok">
</p>
</form>
</td>
</tr>
</table>
<font color="white">When you upload something, it is put in a moderation queue and will NOT be put online until I have seen, and approved it.</font>
</body>
</html>
uploadForm2.php
PHP Code:
<html>
<head>
<title>PHP Uploader|2</title>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
<style type="text/css">
.text1 {font-family: Arial, Helvetica, sans-serif;font-size: 12px;color: White;text-align : left;}
.text2 {font-family: Arial, Helvetica, sans-serif;font-size: 12px;color: Silver;text-align : left;}
.titre1 {font-family: Arial, Helvetica, sans-serif;font-size: 12px;font-weight: bold;color: #FFFFFF;}
.titre2 {font-family: Arial, Helvetica, sans-serif;font-size: 12px;font-weight: bold;color: #cccccc;}
</style>
</head>
<body bgcolor="#525A73">
<table width="500" border="0" cellspacing="0" cellpadding="0" align="center">
<tr>
<td class="text1">
<form name="form1" method="post" action="uploadForm2.php">
Enter the number of uploads. Max is 9.</p>
<input name="uploadNeed" type="text" id="uploadNeed" maxlength="1">
</p>
<input type="submit" name="Button1" value="Ok">
</p>
</form>
</td>
</tr>
</table>
<font color="white">When you upload something, it is put in a moderation queue and will NOT be put online until I have seen, and approved it.</font>
</body>
</html>
uploadForm2.php
PHP Code:
<html>
<head>
<title>PHP Uploader|2</title>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
<style type="text/css">
.text1 {font-family: Arial, Helvetica, sans-serif;font-size: 12px;color: White;text-align : left;}
.text2 {font-family: Arial, Helvetica, sans-serif;font-size: 12px;color: Silver;text-align : left;}
.titre1 {font-family: Arial, Helvetica, sans-serif;font-size: 12px;font-weight: bold;color: #FFFFFF;}
.titre2 {font-family: Arial, Helvetica, sans-serif;font-size: 12px;font-weight: bold;color: #cccccc;}
</style>
</head>
<body bgcolor="#525A73">
[img]header.gif[/img]
<table width="500" border="0" cellspacing="0" cellpadding="0" align="center">
<tr>
<td class="text1">
<form name="form1" enctype="multipart/form-data" method="post" action="processFiles.php">
<?
// 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
}
?>
<input name="uploadNeed" type="hidden" value="<? echo $uploadNeed;?>">
<input type="submit" name="Submit" value="Upload!">
</p>
</form>
</td>
</tr>
</table>
</body>
</html>
processFiles.php
PHP Code:
<html>
<head>
<title>PHP Uploader|2</title>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
<style type="text/css">
.text1 {font-family: Arial, Helvetica, sans-serif;font-size: 12px;color: White;text-align : left;}
.text2 {font-family: Arial, Helvetica, sans-serif;font-size: 12px;color: Silver;text-align : left;}
.titre1 {font-family: Arial, Helvetica, sans-serif;font-size: 12px;font-weight: bold;color: #FFFFFF;}
.titre2 {font-family: Arial, Helvetica, sans-serif;font-size: 12px;font-weight: bold;color: #cccccc;}
</style>
</head>
<body bgcolor="#525A73">
<table width="500" border="0" cellspacing="0" cellpadding="0" align="center">
<tr>
<td class="text1">
<form name="form1" enctype="multipart/form-data" method="post" action="processFiles.php">
<?
// 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
}
?>
<input name="uploadNeed" type="hidden" value="<? echo $uploadNeed;?>">
<input type="submit" name="Submit" value="Upload!">
</p>
</form>
</td>
</tr>
</table>
</body>
</html>
processFiles.php
PHP Code:
<html>
<head>
<title>PHP Uploader|2</title>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
<style type="text/css">
.text1 {font-family: Arial, Helvetica, sans-serif;font-size: 12px;color: White;text-align : left;}
.text2 {font-family: Arial, Helvetica, sans-serif;font-size: 12px;color: Silver;text-align : left;}
.titre1 {font-family: Arial, Helvetica, sans-serif;font-size: 12px;font-weight: bold;color: #FFFFFF;}
.titre2 {font-family: Arial, Helvetica, sans-serif;font-size: 12px;font-weight: bold;color: #cccccc;}
</style>
</head>
<body bgcolor="#525A73">
[img]header.gif[/img]
<table width="500" border="0" cellspacing="0" cellpadding="0" align="center">
<tr>
<td class="text1">
<form name="form1" enctype="multipart/form-data">
<?
$uploadNeed = $_POST['uploadNeed'];
// start for loop
for($x=0;$x<$uploadNeed;$x++){
$file_name = $_FILES['uploadFile'. $x]['name'];
// strip file_name of slashes
$file_name = stripslashes($file_name);
$file_name = str_replace("'","",$file_name);
$copy = copy($_FILES['uploadFile'. $x]['tmp_name'],$file_name);
// check if successfully copied
if($copy){
echo "$file_name | Uploaded!
";
}else{
echo "$file_name | borked!
";
}
} // end of loop
?>
</form>
</td>
</tr>
</table>
</body>
</html>
Thanks.
<table width="500" border="0" cellspacing="0" cellpadding="0" align="center">
<tr>
<td class="text1">
<form name="form1" enctype="multipart/form-data">
<?
$uploadNeed = $_POST['uploadNeed'];
// start for loop
for($x=0;$x<$uploadNeed;$x++){
$file_name = $_FILES['uploadFile'. $x]['name'];
// strip file_name of slashes
$file_name = stripslashes($file_name);
$file_name = str_replace("'","",$file_name);
$copy = copy($_FILES['uploadFile'. $x]['tmp_name'],$file_name);
// check if successfully copied
if($copy){
echo "$file_name | Uploaded!
";
}else{
echo "$file_name | borked!
";
}
} // end of loop
?>
</form>
</td>
</tr>
</table>
</body>
</html>
Thanks.