teparky Posted February 8, 2012 Share Posted February 8, 2012 Hi Guys, Here a bit of a stupid question, I have a set of Submit Buttons that need to have different values. This is because I do a If(isset($_POST['VALUE'])). So what I have is buttons that represent a User, when the user clicks the button next to the user name it posts the value back to the page and then loads a new function. Does anyone know if this is possible. Am I able to use the <input name="user[$value]" type="submit" value="View Profile" />. Regards Thomas pARK Quote Link to comment https://forums.phpfreaks.com/topic/256656-mulitple-button-with-different-values/ Share on other sites More sharing options...
digibucc Posted February 8, 2012 Share Posted February 8, 2012 i would set it as the value, not the name. but the theory would work. Quote Link to comment https://forums.phpfreaks.com/topic/256656-mulitple-button-with-different-values/#findComment-1315747 Share on other sites More sharing options...
PaulRyan Posted February 8, 2012 Share Posted February 8, 2012 You shouldn't rely on the value of submit buttons for form processing and some browsers do not send the submit buttons name and value along with the form submission. There is an alternative, like sending a hidden field with an its name as "action" and the value as the action for each different form. Regards, PaulRyan. Quote Link to comment https://forums.phpfreaks.com/topic/256656-mulitple-button-with-different-values/#findComment-1315757 Share on other sites More sharing options...
digibucc Posted February 8, 2012 Share Posted February 8, 2012 absolutely right on the hidden field, that'd be better regardless i think. but i was unaware the submit value was undependable. cheers Quote Link to comment https://forums.phpfreaks.com/topic/256656-mulitple-button-with-different-values/#findComment-1315868 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.