Client Side Things
 
Forums: » Register « |  User CP |  Games |  Calendar |  Members |  FAQs |  Sitemap |  Support | 
User Name:
Password:
Remember me
Go Back   Codewalkers ForumsOther TechnologiesClient Side Things

Reply
Add This Thread To:
  Del.icio.us   Digg   Google   Spurl   Blink   Furl   Simpy   Y! MyWeb 
Thread Tools Search this Thread Rate Thread Display Modes
 
Unread Codewalkers Forums Sponsor:
  #1  
Old January 23rd, 2004, 07:54 PM
LADYTAN81 LADYTAN81 is offline
Codewalkers Newbie (0 - 499 posts)
 
Join Date: Apr 2007
Posts: 1 LADYTAN81 User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: < 1 sec
Reputation Power: 0
Send a message via AIM to LADYTAN81
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
  1.  
  2. <form name="file_upload" action="./upload_file.php"  method="POST" enctype="multipart/form-data">
  3.  <center>
  4.  <input type=hidden name="program" value="market">
  5.  


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
  1.  
  2. <?php
  3. $knock = "781-890-9522";
  4. $conn = @ocilogon("SAPNET_WEBSITE_PROXY",$knock,"oracle3.waltham");
  5.  
  6.  
  7.  
  8. $random_id = rand(100, 999).rand(100, 999);
  9. $does_exist = true;
  10. while ($does_exist){
  11.   // check to see if it exists
  12.   $stmt = OCIParse($conn, "select SHIPMENT_FILE_ID from SAPNET_WEBSITE.SAPNET_WEBSITE_FILES");
  13.   OCIExecute($stmt);
  14.   $nrows = OCIFetchStatement($stmt, $ids);
  15.   OCIFreeStatement($stmt);
  16.   if (in_array($random_id, $ids["SHIPMENT_FILE_ID"])){
  17.     // if it does exist
  18.     $random_id = rand(100, 999).rand(100, 999);
  19.   } else {
  20.     $does_exist = false;
  21.   }
  22. }
  23.  
  24. print($progam);
  25. $file_name = $HTTP_POST_FILES['my_file']['name'];
  26. $file_type = $HTTP_POST_FILES['my_file']['type'];
  27. $lob = OCINewDescriptor($conn, OCI_D_LOB);
  28. $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";
  29. $stmt = OCIParse($conn, $insert);
  30. OCIBindByName($stmt, ":FID", &$random_id, -1);
  31. OCIBindByName($stmt, ":FNAME", &$file_name, -1);
  32. OCIBindByName($stmt, ":FDESC", &$file_desc, -1);
  33. OCIBindByName($stmt, ":FTPY", &$file_type, -1);
  34. OCIBindByName($stmt, ":FLOC", &$progam, -1);
  35. OCIBindByName($stmt, ":FDATA", &$lob, -1, OCI_B_BLOB);
  36.  
  37. OCIExecute($stmt, OCI_DEFAULT);
  38. $error=1;
  39.   if ($lob->savefile($my_file)){
  40.     OCICommit($conn);
  41.     $msg = "New+File+Added";
  42.   } else {
  43.     $error=21;
  44.     $msg = "Couldn't upload file.";
  45.   }
  46. Header("Location: marketing.php?error=".$error, false);
  47. OCILogoff($conn);
  48.  
  49.  
  50. ?>
  51.  

Reply With Quote
  #2  
Old January 23rd, 2004, 09:27 PM
Andrew's Avatar
Andrew Andrew is offline
Moderator
Click here for more information. Click here for more information
 
Join Date: Apr 2007
Location: United Kingdom
Posts: 1,945 Andrew User rank is Private First Class (20 - 50 Reputation Level)Andrew User rank is Private First Class (20 - 50 Reputation Level)  Folding Points: 2429 Folding Title: Novice Folder
Time spent in forums: 4 Days 5 h 58 m 47 sec
Reputation Power: 3
RE: Posting hidden Inputs fields

You probably dont have register_globals turned on in the php.ini file. To fix this add this code anywhere in your script.

php Code:
Original - php Code
  1.  
  2. <?php
  3. $program=$_POST['program'];
  4. ?>


that will make the variable $program ready for use this however is not a client side issue. Im sure on of the admins will move it.

Reply With Quote
Reply

Viewing: Codewalkers ForumsOther TechnologiesClient Side Things > Posting hidden Inputs fields


Thread Tools  Search this Thread 
Search this Thread:

Advanced Search
Display Modes  Rate This Thread 
Rate This Thread:


Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
View Your Warnings | New Posts | Latest News | Latest Threads | Shoutbox
Forum Jump


Forums: » Register « |  User CP |  Games |  Calendar |  Members |  FAQs |  Sitemap |  Support | 
  
 





© 2003-2008 by Developer Shed. All rights reserved. DS Cluster 1 hosted by Hostway
Stay green...Green IT