I have a basic upload file... A strange problem
I use a form as followed
<FORM ACTION="order_functions.php" METHOD="Post" ENCTYPE="multipart/form-data">
If I Use ENCTYPE="multipart/form-data"
I lose the varaibles need to check form (Don't Know Why)
But If I take it out the varaibles work but it gives a error f can't find file
below is code for both pages
FORM PAGE:
<FORM ACTION="order_functions.php" METHOD="Post" ENCTYPE="multipart/form-data">
<input name="sub_id" type="hidden" value="<? echo $sub_id ?>">
<input type="file" size="20" name="the_file" tabindex="1">
<input type="submit" value="Upload Form" name="o_submit" tabindex="2"></form>
SCRIPT:
if ($o_submit) {
db connect();
$the_path = "/www/sub_form/pdf_forms/";
// Try to strip slashes
$the_file = stripslashes($the_file);
if ($the_file == "") {
echo "There is no file to upload";
} else {
// Get suffix
$ext = explode(".",$the_file);
if ($ext[1] == "pdf") {
if(copy($the_file, $the_path.$file_name)) {
$update = "UPDATE subpoenas SET
upload_file = '$the_file_name',
upload_access = '1' WHERE sub_id = '$sub_id'";
$sql = db_query($update);
echo "<center>Order Has Updated - File Uploaded was
<b>$the_file_name</b></center><BR><BR>";
unlink($the_file);
} else {
echo "ERROR UPLOADING FILE<BR><BR>";
exit;
}
} else {
echo "<center>This is not a PDF file
you can only upload .pdf files for this system<br>
<a href=\"Javascript:history.back(1)\"><< BACK</a></center>";
}
}
}
Note: This same script work on another server
Thanks in advance for any help