PDA

View Full Version : help quick



arisnick
05-04-2006, 03:14 AM
I have a page at http://www.familytimerentals.com/contactus.html right now i have it so that when the form is completed it is emailed to me through a thankyou php page. I want to be able to have the form mailed to a different email address everytime the closest store changes. Such as familytime05********.com if mason city is selected Is this possible??

Girlonthehill
05-04-2006, 03:50 AM
I have a page at http://www.familytimerentals.com/contactus.html right now i have it so that when the form is completed it is emailed to me through a thankyou php page. I want to be able to have the form mailed to a different email address everytime the closest store changes. Such as familytime05********.com if mason city is selected Is this possible??
I would say it's very possible but would involve you learning a little more about writing scripts. It may be worth running a google check to see if you can find anything.

Andy128
05-04-2006, 06:22 AM
arisnick,
First- you would have to set up different e-mails in your BV web mail for each store. Then you could have each forwarded to what ever out-side e-mail you want. Remember- you must send your form info to a BV e-mail address for SMPT purposes. Once there- redirecting is ok.

The code will most likely will require you to seperate your php script from the thankyou page and create a seperate php processing page.

If Naveldesign does not come along for this- I will see what I can find.

Andy

navaldesign
05-04-2006, 06:47 AM
You will need smtp authentication to do this, though if you are on ns5/6, 7/8 or 9/10 it will even work without it (don't ask me WHY, it shouldn't!)

There are two ways to do that:
1. Give your "Closest Store" field items, values equal to the email you want the form submitted to. Then the script will "see" that and will send the email there. This is the easiest solution, but lets your email address in public vew, so chances are that you will have your mailbox full of spam just sometime after you go on the air.
2. If you only have these 8 -10 emails, then you can insert them directly in the script, so they are not visible. The script will check the visitors selection, and "choose" the wright email address to send the mail to.

If SMTP authentication proves necessary, have a look at how you can send email this way, by examining the Tell A Friend Script (http://www.vodahost.com/vodatalk/bluevoda-tips-tricks-shortcuts/4782-tell-friend-script.html) mailing mecchanism in the Tips and Trics section of the forum.

If you find problems, post back and i'll see what i can do.

Andy128
05-04-2006, 02:22 PM
arisnick,
I have tested this and it works.
You need to create the necessary e-mails in your BV account.
Here they are mail1, mail2 and mail3
As I do not know what php script you have used- I cannot taylor it to
meet the total needs of your form. But if you have created your form then you will be able to modify the php script to carry out what you want to do.
Basically- you need to change the combo box with all the stores to a
radio button set up (that is the manner in which I created it and tested it)
Have a common name for the radio buttons - here it is "store"

Then simply create some if statments as below. The script will check to see if the condition is true- if it is it will execute what follows in the { }.
If it is false- the script will move on to check the next statement.



<?PHP
if ($store == 'store1')
{$mailto = "mail1@yourdomain.com";}
elseif ($store == 'store2')
{$mailto = "mail2@yourdomain.com";}
elseif ($store == 'store3')
{$mailto = "mail3@yourdomain.com";}


$email = $HTTP_POST_VARS[email];
$mailsubj = "From multistore form";
$mailhead = "From: $email\n";
reset ($HTTP_POST_VARS);
$mailbody = "Values submitted from web site form:\n";
while (list ($key, $val) = each ($HTTP_POST_VARS))
{
$mailbody .= "$key : $val\n";
}
mail($mailto, $mailsubj, $mailbody, $mailhead);
header("Location: thankyou.html");
?>

Hope this helps some.

Andy