Jump to content

Form auto response needed


tim_ver

Recommended Posts

 

 

    I have a form now works great but I need each of the forms to have there own autoresponse's sent back to the email the user enters in the form. I would use the one on the server side for the email it is getting sent to but there are four different forms that need four different responses so it would not work.

 

 

Can someone please help me here on how to do this.

 

 

Any questions just ask me, or if you need to see the code I have now.

 

Thanks

Link to comment
https://forums.phpfreaks.com/topic/45375-form-auto-response-needed/
Share on other sites

Ok, here you go. If you need more of the code or a specific part let me know.

 

<tr><td>How did you find out about this website:</td></tr>

    <tr><td>

    <select name="How_did_you_find_us">

    <option value="Billboard">Billboard</option>

    <option value="Newspaper">Newspaper</option>

    <option value="Magazine">Magazine</option>

    <option value="Word of mouth">Word of mouth</option>

    <option value="Radio">Radio</option>

    <option value="TV">TV</option>

    </select>

    </td></tr>

    <tr><td align="center"><input type="submit"/></td></tr>

    <tr>

    <td colspan="2"><font color="red">* = Fields are required</font></td>

    </tr>

    </table>

    </form>

I added this to the form:

 

$autotype

autotype = 1

 

 

And this to the send.php

 

 

if (autotype == 1){

mail(email to, Email, Thank you for your request. We will be in touch in 24  hours.)

}

 

Would lthis work, I would change from 1 to 2 and then 3 and so on. Am I missing anything?

 

please help thanks.

Ok, should I put bot snipits of code at the top of each on does it matter?

 

 

This is what I have now:

 

In the form:

 

$autotype

$autotype = 1

 

 

In send.php:

 

if ($autotype == 1){

mail(email to, Email, Thank you for your request. We will be in touch in 24  hours.)

}

 

 

Thanks

its a little hard to say without seeing the form and code,

 

in the form you can have a hidden field set to 1,2,3 etc..

 

then in the send.php have something like

 

<?php
switch($_GET['autotype'])
{
case "1":
mail($_GET['name'], $_GET['email'], "Thank you for your request. We will be in touch in 24  hours.");
break;

case "2":
mail($_GET['name'], $_GET['email'], "Sorry we're not home");
break;

case "3":
mail($_GET['name'], $_GET['email'], "You're fired");
break;

}
?>

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.