PDA

View Full Version : PHP Forms Assistance



tpd1405
03-03-2006, 09:44 PM
I have a very simple php form on my site, but I was just wondering if anyone could tell me how to customize it so that:

1. The site visitor could select the person they want to contact from a drop-down list. (I know how to put a drop down list on the form, but I want the form message to go to the person selected.)

2. The user would get a generic e-mail reply from my site.

Any help would be greatly appreciated.

Watdaflip
03-04-2006, 04:19 AM
Its depends how it is setup. If the action of your form submits to an email, your system is too simple. The action has to be to a php page where the email is processed. If don't have it set up with the action being an email address then ill give you dont code to let them select and email

Also, with the reply, you can login to cpanel and use an autoresponder, but I beleive I read somewhere on this forum that someone said it doesn't work unless the email sent on the form was using smtp, although I might be wrong there

navaldesign
03-04-2006, 06:32 AM
Watdaflip is quite correct. The drop down value selected will have to match that persons (or company department or whatever you want it to be) email. You can do this by either puting their email addresses directly in the drop down list, or by linking the names of the persons to their email adresses. If you go for this last option, this "match" will have to take place inside the script. You can follow a simple way to do this: once the php script is called, it compares the person (or department) name to the pre-defined values that you have inserted in the script, it determines the correct email address that has to be in the script itself, and then sends the email there. If you don't use SMTP authentication, these email addresses have to be on your Vodahost account, not third party ISP's ones. If you go for this option, the only way to have an autoresponder, is to set one for every email address, from your control panel.
If you use SMTP authentication, the autoresponder can be part of the script itself. To see a script with SMTP authentication please have a look at http://www.vodahost.com/vodatalk/bluevoda-tips-tricks-shortcuts/4782-tell-friend-script.html

Please also note that you can go further: by using hidden fields in the form, you can pass over the emails and the message of the autoresponder to the script, when you want to add or modify something, with no need for modifications on the script itself. Of course the initial script becomes a little bit more complicated but you don't need to touch it in the future if you make any changes.