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 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> 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 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
Archived
This topic is now archived and is closed to further replies.