|
Posting hidden Inputs fields
Ok here is the basic gist of what I would like to do. I have a form that is being used to upload a file into a oracle database. I have the upload working when I don't include a hidden input to specify the location it was called from(Desperately need this)
here is the HTML
php Code:
Original
- php Code |
|
|
|
<form name="file_upload" action="./upload_file.php" method="POST" enctype="multipart/form-data"> <center> <input type=hidden name="program" value="market">
Basically the value of the input is considered null. It appears that it never gets posted.
Here is the php code just in case you want to see it... It was working perfectly until I added the hidden input.
php Code:
Original
- php Code |
|
|
|
<?php $knock = "781-890-9522"; $conn = @ ocilogon("SAPNET_WEBSITE_PROXY", $knock, "oracle3.waltham"); $random_id = rand(100, 999). rand(100, 999); $does_exist = true; while ($does_exist){ // check to see if it exists $stmt = OCIParse($conn, "select SHIPMENT_FILE_ID from SAPNET_WEBSITE.SAPNET_WEBSITE_FILES"); if (in_array($random_id, $ids["SHIPMENT_FILE_ID"])){ // if it does exist $random_id = rand(100, 999). rand(100, 999); } else { $does_exist = false; } } $file_name = $HTTP_POST_FILES['my_file']['name']; $file_type = $HTTP_POST_FILES['my_file']['type']; $insert = "insert into SAPNET_WEBSITE.SAPNET_WEBSITE_FILES (shipment_file_id, file_name, file_desc, file_type, file_loc, file_data) values (:FID, :FNAME, :FDESC, :FTPY, :FLOC, EMPTY_BLOB()) returning file_data into :FDATA"; $error=1; if ($lob->savefile($my_file)){ $msg = "New+File+Added"; } else { $error=21; $msg = "Couldn't upload file."; } Header("Location: marketing.php?error=". $error, false); ?>
|