PDA

View Full Version : MySQL form to database - mailchimp



euanc
February 23rd, 2009, 03:30 PM
hi there,

i want to create a php contact form which sends an email to a specific address but at the same time passes the information to a database which i can then export to csv and use it to send emails via mailchimp...

any idea on how i would go about doing something like this?

euan

chrisclick
February 23rd, 2009, 03:49 PM
you could, on the mailer.php page or whatever, do your mail(); function then do the MySQL INSERT...

e.g.



<?php

//codez
if(isset($_whatever)){
mail(/*more code*/);
//MySQL Connect
mysql_query("INSERT INTO example
(to, content) VALUES('$to', '$content') ")
or die(mysql_error());
}else{
echo 'Blarg!';
}
?>



or summat?