pwes24 Posted December 12, 2007 Share Posted December 12, 2007 Hello everyone. Say you have two forms on a page that gather different information. How do i make sure that script working on a particular form is called when the other form is submitted? Do I use, if($_POST['submit']) { ? and does the 'submit' stand for the name of the submit button? Thanks for reading this post. Quote Link to comment Share on other sites More sharing options...
slpctrl Posted December 12, 2007 Share Posted December 12, 2007 lol. Use: If (isset($_POST['Submit'])){ //Coodeee } do some research on isset, it will help you tremendously. Actually you would want to use the form field, not submit value. Quote Link to comment Share on other sites More sharing options...
pwes24 Posted December 12, 2007 Author Share Posted December 12, 2007 What do mean the form field? Can you explain more please? Thank you. Quote Link to comment Share on other sites More sharing options...
Stooney Posted December 12, 2007 Share Posted December 12, 2007 say you have <input type="text" name="var1"> in a form. then you would do if(isset($_POST['var1'])){ //code } Quote Link to comment Share on other sites More sharing options...
slpctrl Posted December 12, 2007 Share Posted December 12, 2007 What do mean the form field? Can you explain more please? Thank you. Ok let's say this is the HTML form: <html> <body> <form> <input type="text" name="value"> </form> Then you're PHP would look something like this: If (isset($_POST["value"])) { //code } Else { } Quote Link to comment 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.