Creating Own Php Form Mail

liunx

Guest
I have a form to subscribe to my newsletter. I need to write a script that the contents of a form to me so I can add that person to my email list. Also, I need the script to send a message back to the person who filled out the form -- like a welcome message. The problem is that FormMail won't support this, but I can write a php file that can. <br /><br />How can upload a php file, and whereto -- does this hosting provider support this option.<br /><br />Also if you know a better way, that's great too. Basically I want people who fill out my form to join the newsletter to be automatically subscribed to the service, and then a message to be immediately sent to their inbox when they join -- to welcome them. It is important that I get their "real name" too. Thanks for the help!<!--content-->
yeah you can do it. i assume you know how to code php. you need to point your <!-- w --><a class="postlink" href="http://www.yoursite.com/form.html">www.yoursite.com/form.html</a><!-- w --> page to run <!-- w --><a class="postlink" href="http://www.yoursite.com/script.php">www.yoursite.com/script.php</a><!-- w --> on submit. the form will pass the name, email, other contents to the php script. then the php script will do 2 things. <br /><br />1) connect to your mySQL db, insert the user info to your mailing list DB table, and<br />2) use the php mail() function to send your user a mail with your message.<br /><br />then when you want to send an email, you can make a little form processing script that will do the following.<br /><br />1) recieve your message from a form.<br />2) select all the emails from the mailing list DB table<br />3) use the mail() function to email those users.<br /><br />TCH supports PHP and mySQL. It also has CPanel, so you can upload files from your PC to your remote server. Easy as pie.<br /><br />the last thing to keep in mind is that SPAM SUCKS. check the TOS before you start up a mailing list. not saying you are a spammer, but people might read this later and i don't want bill getting mad at me. <br /><br />hope this helps,<br />chuck<!--content-->
great, thanks for the help. This will be an opt-in only mailing list, so I don't think there'll be any misconduct here. A couple things though -- is the DB secure, in that I am the only person who can access it (I've never created one before), and also, when writing a php script using notepad, do I just save it as file.php, because when I go to load it, the file is then called file.php.txt <br /><br />Thanks for the help. This is all self taught for me, so its hard to grasp at first.<!--content-->
only the people that know your password will have access to your DB, so be careful where you code your password<br /><br />and yes you will need to save each file w/ a .php extension. if you are doing it locally, just right click on it and rename it. or you could use wordpad, which lets you keep extensions.<!--content-->
 
Top