[thelist] php add email to a mysql db

jon steele jjsteele22 at yahoo.com
Tue Aug 13 09:15:16 CDT 2002


In this situation you could add the email to the database using another caller of some kind, like
a pop-up window.

<form name="myForm" onsubmit="if(documnet.myForm.addToEmailList.checked)
window.open('addToEmailList.php?email='+document.myform.email.value">

I don't understand how adding the code to insert the email into database on the next page in the
order will screw up the order code...you are simply adding an extra query to the rest of the php
script.

Anyway, hth.

--- Andrew Maynes <andrew at uk-webdeveloper.co.uk> wrote:
> this is really useful and helped alot, however I had better run this by you.
>
> The form I am using already has an email field which I dont want to change,
> except to add a little tick box next to it.  This is the existing form element
> in form 1.
>
> <TR><TD>E-mail Address</TD><TD><input name="Email" size="30"></TD></TR>
>
>
> I have added some code into the form 2 but everything else doesn't work!  the
> form is being used as an order form so when the code is added the order info
> isn't being sent, which indicated the adding to a mailing list code is disabling
> the other code?  Which doesn't seem logical!
>
> Andrew
>
>
> -----Original Message-----
> From: thelist-admin at lists.evolt.org
> [mailto:thelist-admin at lists.evolt.org]On Behalf Of jon steele
> Sent: Monday, August 12, 2002 10:32
> To: thelist at lists.evolt.org
> Subject: Re: [thelist] php add email to a mysql db
>
>
> Hey Andrew,
>
> Sure you can.
>
> Create a checkbox in the form:
>
> <input type="checkbox" name="addToList" value="yes">
>
> Then on the receiving page...
>
> if(isset($addToList) && $addToList == "yes"){
>    //assuming there's a form field called email
>    $throwItIn = mysql_query("insert into mylistofemails
> values('".$_POST['email']."');
> }
>
>
> --- Andrew Maynes <andrew at uk-webdeveloper.co.uk> wrote:
> > Hi all
> >
> > glad we are back online, is it just me or is everyoner getting 2-3 mails of
> the
> > same post?
> >
> > anyway here is the question, I have a form that I would like to get the email
> > inserted into a MySQL db is this possible?  I mean possible to use the
> existing
> > form elements and adding a tick box sent me a weekly newsletter?
> >
> > Thank you
> >
> > Andrew
> > ---
> > Outgoing mail is certified Virus Free.
> > Checked by AVG anti-virus system (http://www.grisoft.com).
> > Version: 6.0.381 / Virus Database: 214 - Release Date: 8/2/02
> >
> > --
> > For unsubscribe and other options, including
> > the Tip Harvester and archive of thelist go to:
> > http://lists.evolt.org Workers of the Web, evolt !
>
>
> __________________________________________________
> Do You Yahoo!?
> HotJobs - Search Thousands of New Jobs
> http://www.hotjobs.com
> --
> For unsubscribe and other options, including
> the Tip Harvester and archive of thelist go to:
> http://lists.evolt.org Workers of the Web, evolt !
>
> ---
> Incoming mail is certified Virus Free.
> Checked by AVG anti-virus system (http://www.grisoft.com).
> Version: 6.0.381 / Virus Database: 214 - Release Date: 8/2/02
>
> ---
> Outgoing mail is certified Virus Free.
> Checked by AVG anti-virus system (http://www.grisoft.com).
> Version: 6.0.381 / Virus Database: 214 - Release Date: 8/2/02
>
> --
> For unsubscribe and other options, including
> the Tip Harvester and archive of thelist go to:
> http://lists.evolt.org Workers of the Web, evolt !


__________________________________________________
Do You Yahoo!?
HotJobs - Search Thousands of New Jobs
http://www.hotjobs.com



More information about the thelist mailing list