[SOLVED] On successful upload goto new page automatically
Posted: Wed Jun 23, 2004 2:02 pm
Ok I would like this page I am working on to automatically goto the next page once the upload is successful I have the command in right now that says upload successful and amunsure how to tell it to execute to goto the next page. here is the code.
Basically I would like to get rid of the last 5 lines of code and change this line in the code
by taking out Object has been uploaded to with this code to load the page testrec.php?recordID=<?php echo $newfile; ?>"
I hope this makes sense.
Code: Select all
<?php
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1"><basefont face="Verdana" size="2">
</head>
<body background="images/covbckgrnd.jpg">
<p><font color=blue size=2>
<!-- <font face=verdana size=2 color =blue> Web Editor v 2.0</font> -->
<font face=verdana size=3 color =#CC6600> Select the file you wish
to upload</font>
<?php
set_time_limit(0);
$numoffile = 1;
// Fix path of your file to be uploaded
$file_dir = "Files/cod/"; // folder name for uploaded file
if ($_POST) {
for ($i=0;$i<$numoffile;$i++) {
if (trim($_FILES['myfiles']['name'][$i])!="") {
$newfile = $file_dir.$_FILES['myfiles']['name'][$i];
move_uploaded_file($_FILES['myfiles']['tmp_name'][$i], $newfile);
}
}
}
if (isset($i)&&$i>0) print "<br>Object has been uploaded.<br>";
print "<form method='post' enctype='multipart/form-data'>";
for($i=0;$i<$numoffile;$i++) {
print "<input type='file' name='myfiles[]' size='30'><br>";
}
print "<br><input type='submit' name='action' value='Copy Files'>";
print "</form>";
?>
</font>
</p>
<a href="testrec.php?recordID=<?php echo $newfile; ?>"><img src="images/adduser.jpg" width="175" height="46" border="0"></a>
</body>
</html>
?>Basically I would like to get rid of the last 5 lines of code and change this line in the code
Code: Select all
<?php
if (isset($i)&&$i>0) print "<br>Object has been uploaded.<br>";
?>I hope this makes sense.