using Ajax just for a simple matter like that is too much work.
If you use include files and have the form displayed on every page, leave the action field empty, this way the form will submit to the same page you are on, or grab the page name and query string.
Inside the form ad a hidden field named "email_subscribe" or something unique with the value="1".
Inside the include page, before the form add your code to verify the email, and if no errors found, either added to a database or email it to yourself, then shown a nice "Thank you" message. |