tim_ver Posted April 3, 2007 Share Posted April 3, 2007 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 Quote Link to comment https://forums.phpfreaks.com/topic/45375-form-auto-response-needed/ Share on other sites More sharing options...
MadTechie Posted April 3, 2007 Share Posted April 3, 2007 would need to see some code 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. don't see how thats a problem ! Quote Link to comment https://forums.phpfreaks.com/topic/45375-form-auto-response-needed/#findComment-220332 Share on other sites More sharing options...
tim_ver Posted April 3, 2007 Author Share Posted April 3, 2007 It is beacause all four forms goto the same email address so need to have something in the form that gets sent back instead. Quote Link to comment https://forums.phpfreaks.com/topic/45375-form-auto-response-needed/#findComment-220397 Share on other sites More sharing options...
MadTechie Posted April 3, 2007 Share Posted April 3, 2007 humm well it shouldn't be hard up update, can you post some code Quote Link to comment https://forums.phpfreaks.com/topic/45375-form-auto-response-needed/#findComment-220414 Share on other sites More sharing options...
tim_ver Posted April 5, 2007 Author Share Posted April 5, 2007 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> Quote Link to comment https://forums.phpfreaks.com/topic/45375-form-auto-response-needed/#findComment-221813 Share on other sites More sharing options...
AndyB Posted April 5, 2007 Share Posted April 5, 2007 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. Quote Link to comment https://forums.phpfreaks.com/topic/45375-form-auto-response-needed/#findComment-221871 Share on other sites More sharing options...
tim_ver Posted April 5, 2007 Author Share Posted April 5, 2007 Ok, I have used this for include in a php page but never as an auto response getting sent back out. Is there a tutorial or sample code for this? Thanks much Quote Link to comment https://forums.phpfreaks.com/topic/45375-form-auto-response-needed/#findComment-222243 Share on other sites More sharing options...
tim_ver Posted April 5, 2007 Author Share Posted April 5, 2007 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. Quote Link to comment https://forums.phpfreaks.com/topic/45375-form-auto-response-needed/#findComment-222411 Share on other sites More sharing options...
MadTechie Posted April 5, 2007 Share Posted April 5, 2007 first its "$autotype" not "autotype" you need the $ if the send.php is included then yes it seams fine Quote Link to comment https://forums.phpfreaks.com/topic/45375-form-auto-response-needed/#findComment-222458 Share on other sites More sharing options...
tim_ver Posted April 9, 2007 Author Share Posted April 9, 2007 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 Quote Link to comment https://forums.phpfreaks.com/topic/45375-form-auto-response-needed/#findComment-224857 Share on other sites More sharing options...
MadTechie Posted April 9, 2007 Share Posted April 9, 2007 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; } ?> Quote Link to comment https://forums.phpfreaks.com/topic/45375-form-auto-response-needed/#findComment-224932 Share on other sites More sharing options...
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.