droidus Posted August 21, 2011 Share Posted August 21, 2011 i am submitting a form with this button, when run-over, changes the image. here is my button code: <a class="loginBtn" href="" name="login">Login</a> here is my php code that takes it: if (isset($_POST['login'])) { when the button is clicked, it does nothing. why won't it submit? Link to comment https://forums.phpfreaks.com/topic/245388-trouble-submiting-form/ Share on other sites More sharing options...
cssfreakie Posted August 21, 2011 Share Posted August 21, 2011 can you give a reason why it should do anything? I can't see one.. as for practical form submissions: wrap the form in <form> tags and place a submit button inside of it. <form action="action.php" method="post"> <input type="text" name="fatgorillas" value="" /> <input type="submit" name="submit" value="submit this form" /> </form> Link to comment https://forums.phpfreaks.com/topic/245388-trouble-submiting-form/#findComment-1260322 Share on other sites More sharing options...
droidus Posted August 21, 2011 Author Share Posted August 21, 2011 sorry; i do have the form tags around it. Link to comment https://forums.phpfreaks.com/topic/245388-trouble-submiting-form/#findComment-1260333 Share on other sites More sharing options...
cssfreakie Posted August 21, 2011 Share Posted August 21, 2011 well ditch the link you have and use: <input type="submit" name="submit" value="submit this form" /> Link to comment https://forums.phpfreaks.com/topic/245388-trouble-submiting-form/#findComment-1260334 Share on other sites More sharing options...
droidus Posted August 21, 2011 Author Share Posted August 21, 2011 yea i got it now; <input type="submit" src="../Images/login.png" name="login" class="loginBtn" /> thanks. Link to comment https://forums.phpfreaks.com/topic/245388-trouble-submiting-form/#findComment-1260338 Share on other sites More sharing options...
droidus Posted August 22, 2011 Author Share Posted August 22, 2011 the only problem with it now, is that it looks like its the shape of a button... besides that, it works! [attachment deleted by admin] Link to comment https://forums.phpfreaks.com/topic/245388-trouble-submiting-form/#findComment-1260350 Share on other sites More sharing options...
cssfreakie Posted August 22, 2011 Share Posted August 22, 2011 the only problem with it now, is that it looks like its the shape of a button... besides that, it works! You can change that with css. just expirement a bit and keep in mind elements like this have some standard background borders margins etc. You can change all that. Link to comment https://forums.phpfreaks.com/topic/245388-trouble-submiting-form/#findComment-1260362 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.