halben Posted September 13, 2013 Share Posted September 13, 2013 I would like to open a SOAP connection that reflects changes to another database onlywhen the following forms has been submitted(Register & Update profile forms) through WordPress. I am able to get the connection working using a try/catch block statement but it seems like the connection are always present so it's slowing the site down alot and it's not safe. Does anyone know how to check when an user submits a form? All I could think of is using this code: if($_SERVER['REQUEST_METHOD'] == "POST") and doing something like this: if($_SERVER['REQUEST_METHOD'] == "POST"){try{//import soap class// connect to another DB// Do more stuff here... }catch(exception $e){// errror }} Quote Link to comment https://forums.phpfreaks.com/topic/282128-check-if-custom-registration-form-is-submitted-then-open-soapdb-connection/ Share on other sites More sharing options...
fastsol Posted September 13, 2013 Share Posted September 13, 2013 Give the form submit button a specific name for the form in question then just check for that in the POST. if(isset($_POST['registration_button'])) // change registration_button to the name you give the button in your html { //connect to SOAP } Quote Link to comment https://forums.phpfreaks.com/topic/282128-check-if-custom-registration-form-is-submitted-then-open-soapdb-connection/#findComment-1449369 Share on other sites More sharing options...
halben Posted September 13, 2013 Author Share Posted September 13, 2013 Thanks, I'll give it a try. Do you know if there's another method to do so besides the one you and I post? Quote Link to comment https://forums.phpfreaks.com/topic/282128-check-if-custom-registration-form-is-submitted-then-open-soapdb-connection/#findComment-1449372 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.