Hey everyone. I am building a form right now that has 1 input field - email address.
Basically, the form will allow users to add their email addresses into a database, so that they can receive electronic newsletters.
What I want to do is include a 2nd button beside the "submit" button that will alow a user to remove his or her email address from the db as well.
I figure that using a "push button" is the way I need to go, and that I need to create some function that will get the email address in the email address input field, and "post" that by refreshing the page which will activate my PHP script that will recognize the email address is to be removed from the database, and which will do it.
That's what I think needs to happen. Any idea on how this is actually done??
Here's what I'm thinking what to do in my html:
Notice I put the ?remove at the end of the url. Would this work, to give the value "remove" to my php script? If I did it like this, how would I also get the email address to be recognized?
Thanks,
David
Basically, the form will allow users to add their email addresses into a database, so that they can receive electronic newsletters.
What I want to do is include a 2nd button beside the "submit" button that will alow a user to remove his or her email address from the db as well.
I figure that using a "push button" is the way I need to go, and that I need to create some function that will get the email address in the email address input field, and "post" that by refreshing the page which will activate my PHP script that will recognize the email address is to be removed from the database, and which will do it.
That's what I think needs to happen. Any idea on how this is actually done??
Here's what I'm thinking what to do in my html:
Code:
<input type="button" value="Remove Your Address" ONCLICK="window.location.href='newsletter.php?remove'">
Notice I put the ?remove at the end of the url. Would this work, to give the value "remove" to my php script? If I did it like this, how would I also get the email address to be recognized?
Thanks,
David








