Webmaster Forum


Go Back   Webmaster Forum > Web Development > Coding Forum

Coding Forum Problems with your code? Discuss coding issues, including JavaScript, PHP & MySQL, HTML & CSS, Flash & ActionScript, and more.


Reply
 
LinkBack Thread Tools Display Modes
Share |
  #1 (permalink)  
Old 09-28-2007, 07:51 PM
Contributing Member
Latest Blog:
None

 
Join Date: 12-14-05
Posts: 106
iTrader: 0 / 0%
accept post data from form, process, then redirect data to another script

I thought this would be fairly easy, but upon sitting down to do it, now I dunno.
i have an html file with a form, and this POSTs data to a PHP script. it's actually a signup form. i want to add another input box to the signup form to get extra info, but the catch is that the PHP file that process the form is encrypted and i can't edit it. so, my idea was: change the html of the form to submit to myform.php, then i'll process the new data field, and re-POST the form to the original file, "encoded.php".
except i'm not sure how to do that or if it's possible... i could use curl of course, but the user needs to be kept down this path of
user fills form -> i process the data -> original php file processes it, checks for invalid info, etc -> user lands on post-signup page, whether it was a success or it's now telling them what info needs corrected.

suggestions?
 
Reply With Quote
  #2 (permalink)  
Old 09-28-2007, 09:53 PM
digiweb's Avatar
Contributing Member
 
Join Date: 04-07-06
Location: Manchester, NH
Posts: 722
iTrader: 1 / 100%
I'm doing this off the top of my head but it's something like this:

while (list($key, $value) = each($HTTP_POST_VARS)) {
$get_url .= $key . '=' . $value . '&';
}
header ("Location: encryptedpage.php?" . $get_url);
 
Reply With Quote
  #3 (permalink)  
Old 09-28-2007, 10:04 PM
Contributing Member
Latest Blog:
None

 
Join Date: 12-14-05
Posts: 106
iTrader: 0 / 0%
will a script that is coded to process POST variables recognize GET variables?
i wouldn't think so.
 
Reply With Quote
  #4 (permalink)  
Old 09-28-2007, 10:53 PM
digiweb's Avatar
Contributing Member
 
Join Date: 04-07-06
Location: Manchester, NH
Posts: 722
iTrader: 1 / 100%
You're right, I was not thinking.

If you don't want to use curl you could

construct a form and use javascript to push the submit button
or use javascript and http library http://www.phpbuilder.com/columns/jo...l20070730.php3
or
http://netevil.org/blog/2006/nov/htt...p-without-curl
 
Reply With Quote
  #5 (permalink)  
Old 09-29-2007, 02:39 PM
Contributing Member
Latest Blog:
None

 
Join Date: 12-14-05
Posts: 106
iTrader: 0 / 0%
hmm, i'm thinking the best solution may be:
user clicks submit button, it calls a javascript function that first does an ajax call to a script that saves the value of the new form option, then it "clicks" the submit button which goes to the original url as normal.
 
Reply With Quote
Go Back   Webmaster Forum > Web Development > Coding Forum

Reply


Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
 
Thread Tools
Display Modes

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

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are Off
Pingbacks are Off
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
Inserting Data from Form into MS Access Database with Coldfusion websiteideas Coding Forum 5 10-11-2006 07:51 PM


V7N Network
Get exposure! V7N I Love Photography V7N SEO Blog V7N Directory


All times are GMT -7. The time now is 07:54 PM.
Powered by vBulletin
Copyright © 2000-2013 Jelsoft Enterprises Limited.
Copyright © 2003 - 2013 Escalate Media LP




Search Engine Optimization by vBSEO 3.6.0 RC 2 ©2011, Crawlability, Inc.