I'm new to html and forms and want to understand how form fields get submitted and posted to a newsletter signup url.
This is the code I have so far. When someone fills out the form and submits it, will the form action post the name and email to the url and subscribe the user to the newsletter? or do I need some kind of processing file as well?
<FORM action="http://example.com?fname=<firstname>&email=<email>&redirecturl=abcthankyou" method="post">
<p>
<LABEL for="firstname">First name </LABEL>
<INPUT type="text" id="firstname"><p />
<LABEL for="email">Email </LABEL><br />
<INPUT type="text" id="email"><p />
<INPUT type="submit" value="Subscribe"> <INPUT type="reset">
</p>
</FORM>
Thanks in advance for any help.
There are a few problems with your form. You want it to look like this with your extra bits:
The form will then call your action page and any inputs with
name
set will be passed as$_POST
variables as set in yourmethod
. You may want to look at - http://www.w3schools.com/html/html_forms.asp