doubledee Posted September 2, 2011 Share Posted September 2, 2011 Up until now, I have been writing Forms that submit back to themselves. Now I want to break up my code. I usually have this PHP at the top of my forms... <?php // ******************************************** // HANDLE FORM. * // ******************************************** if ($_SERVER['REQUEST_METHOD']=='POST'){ // Form was Submitted (Post). If I change my Form Action to point to another script, will this code work in that new script?? (In other words, will Script_B be able to detect $_SERVER['REQUEST_METHOD']=='POST' ??) Thanks, Debbie Quote Link to comment https://forums.phpfreaks.com/topic/246253-question-about-form-submitted/ Share on other sites More sharing options...
joel24 Posted September 2, 2011 Share Posted September 2, 2011 whichever page the action points to will be able to detect what request method was used to access the page i usually check to see if a form element isset before processing if (isset($_POST['formElementName'])) { //process form } Quote Link to comment https://forums.phpfreaks.com/topic/246253-question-about-form-submitted/#findComment-1264658 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.