I have a form with 3 inputs. 2 text files and a file upload.
If it doesn't pass one of the if tests for the values then I want it to go back to the
form. Since I don't have it all on one page, the form is one page and this script uploader.php is posted when the form is submitted. I don't know how to get the user back to the input form page. See the asterisks ******Doesn't work.
thanks,
$time=time();
$target_path = "file_uploads/";
echo $target_path." target_path";
//Result is "uploads/filename.extension" */
$target_path = $target_path . basename( $_FILES['uploadedfile']['name']);
echo $target_path ."target_path";
echo $_FILES['uploadedfile']['name']."name";
echo $_FILES['uploadedfile']['tmp_name'] ."tmp_name";
if ($_POST['cart_id'] && ($_POST['bu'])){
$cart_id = $_POST['cart_id'];
$bu = $_POST['bu'];
echo $cart_id;
echo $bu;
if(move_uploaded_file($_FILES['uploadedfile']['tmp_name'],$target_path)){
echo "The file ". basename( $_FILES['uploadedfile']['name'])." has been uploaded"." ;
if($_FILES['uploaded']['name']." is not type .csv <a href=# onClick='history.go(-1);'>Go Back</a>");******
} else{
echo "There was an error uploading the file, please try again.< /br>" ;
}
}else{
echo "You are missing the cart_id or bu."." <a href=# onClick='history.go(-1);'>Go Back</a>";*****
exit();
}
I should have validated with javascript but i'm running out of time.
thanks,