Forum Moderators: coopster

Message Too Old, No Replies

form won't submit?

         

generic

4:22 pm on Feb 26, 2009 (gmt 0)

10+ Year Member



Once upon a time long ago I was a decent web developer and after a year-long hiatus, it seems now even the simplest things are eluding me *fully ashamed*

I have the following type of code setup on a page 'newsletter.php' where a user will be able to either use the signup form or the remove form (both on newsletter.php) and for the life of me, I can't get my forms to even submit. Obviously the example provided is a simple test case. Can anyone tell me why the form won't even submit - is it my nasty php? Thanks in advance!

<?php
if($_POST['signup']) {

echo 'You have signed up';

} elseif($_POST['unsubscribe']) {

echo 'You have unsubscribed';

} else {

echo '<form method="post" action="newsletter.php" name="signup">
Add Email: <input type="text" id="add_email"><br />
<input type="button" name="signup" value="Sign Up">
</form>
<hr>
<form method="post" action="newsletter.php" name="unsubscribe">
Remove Email: <input type="text" id="remove_email"><br />
<input type="button" name="unsubscribe" value="Unsubscribe">
</form>';

}
?>

generic

4:40 pm on Feb 26, 2009 (gmt 0)

10+ Year Member



Should have checked my html better, it was actually the input type for the submit buttons, should have been submit not button. thanks anyway, sorry to dumb it up in here.

coopster

4:57 pm on Feb 26, 2009 (gmt 0)

WebmasterWorld Administrator 10+ Year Member



LOL! Don't be so hard on yourself, we all make simple mistakes now and then. Glad you got it sorted :)