gnznroses Posted September 29, 2007 Share Posted September 29, 2007 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? Quote Link to comment https://forums.phpfreaks.com/topic/71121-accept-post-data-from-form-process-then-redirect-data-to-another-script/ Share on other sites More sharing options...
teng84 Posted September 29, 2007 Share Posted September 29, 2007 can you show a little code Quote Link to comment https://forums.phpfreaks.com/topic/71121-accept-post-data-from-form-process-then-redirect-data-to-another-script/#findComment-357682 Share on other sites More sharing options...
Cagecrawler Posted September 29, 2007 Share Posted September 29, 2007 Write your own version of the encrypted script and add in the extra field? If you can't/don't want to do that, then you'd have to add a hidden form on the second page (your php page) with hidden fields for each of the fields that need to be passed across to the encrypted file. Eg: <form method="POST" action="encrypted.php"> <input type="hidden" name="somevar" value="<?php echo $_POST['somevar'];?>"> <input type="hidden" name="anothervar" value="<?php echo $_POST['anothervar'];?>"> </form> EDIT: Just noticed a problem, the form wouldn't be submitted. You'd have to have a button that would say "Continue to Register" or something similar. Quote Link to comment https://forums.phpfreaks.com/topic/71121-accept-post-data-from-form-process-then-redirect-data-to-another-script/#findComment-357683 Share on other sites More sharing options...
gnznroses Posted September 29, 2007 Author Share Posted September 29, 2007 ah, i hadn't really thought of using a second page. i can't really write my own version of the encoded script because i'm not sure of everything it does. one problem with using a second page (my new form -> my script -> old form), or my original idea either, is that the user's account won't be in the DB yet at the time i process the data. so if i take in my new form input, i can't save that in the db alongside the user account because it hasn't actually been created yet. i guess i could use your idea of a second page, instead of interjecting it between the existing form and script, and have a link somewhere, after the user signs up, to my new form. it just may be confusing to the user if an ad says "mention promo code __" and that option isn't on the signup page. Quote Link to comment https://forums.phpfreaks.com/topic/71121-accept-post-data-from-form-process-then-redirect-data-to-another-script/#findComment-357709 Share on other sites More sharing options...
chronister Posted September 29, 2007 Share Posted September 29, 2007 describe exactly what the form is for and what it does...not the encrypted stuff.. as you have already stated you don't know what it does. What fields are in the form? The more info you can give the better Nate Quote Link to comment https://forums.phpfreaks.com/topic/71121-accept-post-data-from-form-process-then-redirect-data-to-another-script/#findComment-357727 Share on other sites More sharing options...
gnznroses Posted September 29, 2007 Author Share Posted September 29, 2007 i don't honestly think it matters. it's just the usual stuff: name, address, etc. it's a signup form. i just want to add one more text input to ask the user something, and then store that info in the db along with their other info (i'll have to add a new field to the existing db table). Quote Link to comment https://forums.phpfreaks.com/topic/71121-accept-post-data-from-form-process-then-redirect-data-to-another-script/#findComment-357728 Share on other sites More sharing options...
gnznroses Posted September 29, 2007 Author Share Posted September 29, 2007 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. Quote Link to comment https://forums.phpfreaks.com/topic/71121-accept-post-data-from-form-process-then-redirect-data-to-another-script/#findComment-358088 Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.