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. Link to comment https://forums.phpfreaks.com/topic/81285-solved-calling-different-script-functions/ 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. Link to comment https://forums.phpfreaks.com/topic/81285-solved-calling-different-script-functions/#findComment-412525 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. Link to comment https://forums.phpfreaks.com/topic/81285-solved-calling-different-script-functions/#findComment-412531 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 } Link to comment https://forums.phpfreaks.com/topic/81285-solved-calling-different-script-functions/#findComment-412536 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 { } Link to comment https://forums.phpfreaks.com/topic/81285-solved-calling-different-script-functions/#findComment-412537 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.