jcstanley Posted May 15, 2007 Share Posted May 15, 2007 Hi I am creating a basic forum for my site. To begin with i just used boring old hyperlinks, but am now converting them to buttons. The problem i have is that when a variable (ie. $id) neededs to be passed it doesn't work: Before (working): <a href='reply.php?id=$id'>Reply</a> After (not working): <FORM METHOD='LINK' ACTION='reply.php?id=$id'><INPUT TYPE='submit' VALUE='Reply' style='color: #ffffff; font-weight:bold; background-color: #003366; font-size:10px'></FORM> When the button is clicked the address bar does not contain the value stored in the $id variable eg: reply.php?id= Can this be solved? Many thanks Quote Link to comment https://forums.phpfreaks.com/topic/51470-solved-passing-variable-with-submit-button/ Share on other sites More sharing options...
New Coder Posted May 15, 2007 Share Posted May 15, 2007 This would work <FORM METHOD='LINK' ACTION='reply.php?'><INPUT TYPE='submit' VALUE='Reply' style='color: #ffffff; font-weight:bold; background-color: #003366; font-size:10px'> <input type=\"hidden\" name=\"id\" value=$id></FORM> Quote Link to comment https://forums.phpfreaks.com/topic/51470-solved-passing-variable-with-submit-button/#findComment-253428 Share on other sites More sharing options...
jcstanley Posted May 15, 2007 Author Share Posted May 15, 2007 Perfect!!!! Thanks very much Quote Link to comment https://forums.phpfreaks.com/topic/51470-solved-passing-variable-with-submit-button/#findComment-253431 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.