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
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>

Link to comment
Share on other sites

Use the include() function to get a 'specific response' from the form processing script based on whichever form was submitted. Add a hidden field to each form so the processing script knows which response text to include.

Link to comment
Share on other sites

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.

Link to comment
Share on other sites

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

Link to comment
Share on other sites

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;

}
?>

Link to comment
Share on other sites

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • 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.