chibineku Posted August 13, 2009 Share Posted August 13, 2009 I am creating an all in one registration/login form, in case someone clicks register by mistake and wants to login without hitting another link, or if it turns out they're already in the database. If I have two buttons, one named register and one named login, will the $_POST variable only return true for the name of the one that is pushed? Link to comment Share on other sites More sharing options...
justsomeguy Posted August 13, 2009 Share Posted August 13, 2009 If they both have the same name then it will submit the value (text) of the button that was clicked for that name. If the buttons have different names I think it will submit both of them. Might as well test it though and find out. Link to comment Share on other sites More sharing options...
chibineku Posted August 13, 2009 Author Share Posted August 13, 2009 You can get the name from the $_POST variable...thank goodness for that! Link to comment Share on other sites More sharing options...
jeffman Posted August 13, 2009 Share Posted August 13, 2009 FWIW, the fastest way to check on something like this is to set your form method to "get" and see what shows up in your address bar. Link to comment Share on other sites More sharing options...
justsomeguy Posted August 13, 2009 Share Posted August 13, 2009 Make sure to test with a few browsers, since the browser is sending the data it's worth it to check that they all follow the same rules. I'm not even sure if that's part of the spec. Link to comment Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.