dombrorj Posted April 16, 2003 Posted April 16, 2003 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. How can upload a php file, and whereto -- does this hosting provider support this option. 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! Quote
chuckmalani Posted April 16, 2003 Posted April 16, 2003 yeah you can do it. i assume you know how to code php. you need to point your www.yoursite.com/form.html page to run www.yoursite.com/script.php on submit. the form will pass the name, email, other contents to the php script. then the php script will do 2 things. 1) connect to your mySQL db, insert the user info to your mailing list DB table, and 2) use the php mail() function to send your user a mail with your message. then when you want to send an email, you can make a little form processing script that will do the following. 1) recieve your message from a form. 2) select all the emails from the mailing list DB table 3) use the mail() function to email those users. TCH supports PHP and mySQL. It also has CPanel, so you can upload files from your PC to your remote server. Easy as pie. 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. hope this helps, chuck Quote
dombrorj Posted April 16, 2003 Author Posted April 16, 2003 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 Thanks for the help. This is all self taught for me, so its hard to grasp at first. Quote
chuckmalani Posted April 16, 2003 Posted April 16, 2003 only the people that know your password will have access to your DB, so be careful where you code your password 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. Quote
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.