pkirsch Posted May 2, 2007 Share Posted May 2, 2007 Hello, I was wondering if (which it probably is) possible to pass info from a form, to a processing script, then to another processing script? I'm thinking it would be using $_POST, $_GET or $_REQUEST. If You Could Please let me know how to do this, that would be great. Thanks for Your time, pkirsch Link to comment https://forums.phpfreaks.com/topic/49685-solved-forms-processing/ Share on other sites More sharing options...
trq Posted May 2, 2007 Share Posted May 2, 2007 if you want uour users to need to click to get to the second processing script, yes. Just use another form and store your data within hidden fields. An even better solution would be to (on the first process script) store the data in the $_SESSION array and then either redirect to the second process script or use a link. Link to comment https://forums.phpfreaks.com/topic/49685-solved-forms-processing/#findComment-243584 Share on other sites More sharing options...
paul2463 Posted May 2, 2007 Share Posted May 2, 2007 when info gets passed from a form it is normally in the form of $_POST so your first processing page will used $_POST['whatever'] variables its up to you how you get the information to the next page, you could use $_SESSION variables or $_GET variables either way works, except that $_GET variables are shown in the address bar so be careful what you show Link to comment https://forums.phpfreaks.com/topic/49685-solved-forms-processing/#findComment-243586 Share on other sites More sharing options...
pkirsch Posted May 2, 2007 Author Share Posted May 2, 2007 No, I don't want the user to click, I want the processor1.php to send the info to processor2.php! Link to comment https://forums.phpfreaks.com/topic/49685-solved-forms-processing/#findComment-243588 Share on other sites More sharing options...
taith Posted May 2, 2007 Share Posted May 2, 2007 depends on your form... $_REQUEST holds both $_GET's data and $_POST's data so you can always access form data through $_REQUEST... now... on your <form method="post/get"> that determines how the form is sending the data to the next page... i use post, nearly always... now... after form is submited... you can access it through $_POST[fieldname]; Link to comment https://forums.phpfreaks.com/topic/49685-solved-forms-processing/#findComment-243592 Share on other sites More sharing options...
trq Posted May 2, 2007 Share Posted May 2, 2007 No, I don't want the user to click, I want the processor1.php to send the info to processor2.php! Then store the data in a $_SESSION and redirect. I must ask though, why do you need 2 processing pages if the 2nd isn't going to be some kind of confirmation? Link to comment https://forums.phpfreaks.com/topic/49685-solved-forms-processing/#findComment-243594 Share on other sites More sharing options...
taith Posted May 2, 2007 Share Posted May 2, 2007 sending automatically from one page to another? best to use $_SESSION's... Link to comment https://forums.phpfreaks.com/topic/49685-solved-forms-processing/#findComment-243595 Share on other sites More sharing options...
paul2463 Posted May 2, 2007 Share Posted May 2, 2007 I agree with thorpe, why have 2 processing pages, if there is no user interaction between the processing pages then just use the one and make it a bit bigger Link to comment https://forums.phpfreaks.com/topic/49685-solved-forms-processing/#findComment-243600 Share on other sites More sharing options...
pkirsch Posted May 2, 2007 Author Share Posted May 2, 2007 We'll I have one processor file that validated the forms and another that adds the info from the forms to a MySQL DB! Link to comment https://forums.phpfreaks.com/topic/49685-solved-forms-processing/#findComment-243617 Share on other sites More sharing options...
paul2463 Posted May 2, 2007 Share Posted May 2, 2007 well one page could do that, run the validation script as you would setting a variable to true or false dependent on the outcome then have an if statement on the bottom saying if(true) insert into database if(false) return to main page Link to comment https://forums.phpfreaks.com/topic/49685-solved-forms-processing/#findComment-243628 Share on other sites More sharing options...
pkirsch Posted May 2, 2007 Author Share Posted May 2, 2007 Actually; yeah, Your right! i think I'll do that! :)Thank you very much for Your time, pkirsch Link to comment https://forums.phpfreaks.com/topic/49685-solved-forms-processing/#findComment-243635 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.