a.amrita86 Posted July 23, 2008 Share Posted July 23, 2008 I need to pass values on button click from html to php.The button should work similar to a hyperlink as given below <a href="temp2.php?id=ID&flag=2&f=TPL_PG">Edit</a> Link to comment https://forums.phpfreaks.com/topic/116125-how-to-pass-values-in-button-click/ Share on other sites More sharing options...
peranha Posted July 23, 2008 Share Posted July 23, 2008 If you mean the edit to work, then you would use $_GET[] on the page $_GET[id] $_GET[flag] $_GET[f] Link to comment https://forums.phpfreaks.com/topic/116125-how-to-pass-values-in-button-click/#findComment-597155 Share on other sites More sharing options...
vbnullchar Posted July 23, 2008 Share Posted July 23, 2008 <input type='button' onclick="location.href='temp2.php?id=ID&flag=2&f=TPL_PG ' " /> Link to comment https://forums.phpfreaks.com/topic/116125-how-to-pass-values-in-button-click/#findComment-597156 Share on other sites More sharing options...
tibberous Posted July 23, 2008 Share Posted July 23, 2008 Or, without javascript: <form action='' method='get'> <input type='hidden' name='id' value='ID'> <input type='hidden' name='flag' value='2'> <input type='hidden' name='f' value='TPL_PG'> <input type='submit' value='OldSchool'> </form> Link to comment https://forums.phpfreaks.com/topic/116125-how-to-pass-values-in-button-click/#findComment-597175 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.