SitePoint Sponsor |
|
User Tag List
Results 1 to 8 of 8
-
Feb 27, 2009, 08:51 #1
- Join Date
- Oct 2008
- Posts
- 140
- Mentioned
- 4 Post(s)
- Tagged
- 0 Thread(s)
html email form to php email form
Hi
I am in the middle of converting a site from html to php. Everything has gone great, except the forms. :-)
Right now I have html forms that send an email (mail cgi) and redirects the user. I would like to use php to send and email (mail cgi) and redirect the use to a thank you page.
Is there a way to clear the information that was put in the form before redirecting the use the a thank you page?
Thanks
Michelle
-
Feb 27, 2009, 08:53 #2Guido - Community Team Leader
The Votes Are In: The Winners of the 2013 Community Awards are...
Blog - Free Flash Slideshow Widget
-
Feb 27, 2009, 09:08 #3
- Join Date
- Oct 2008
- Posts
- 140
- Mentioned
- 4 Post(s)
- Tagged
- 0 Thread(s)
form redirect <input type=hidden name="redirect" value="ThankYou php">
only currently when you submit it redirects to ThankYou php?subject=xxxx
and I do not want a subject.
Thanks
-
Feb 27, 2009, 09:11 #4
This hidden field doesn't do any redirect. There has to be a script that handles the form after submitting it, and that takes the value from the hidden field and handles the redirect.
Guido - Community Team Leader
The Votes Are In: The Winners of the 2013 Community Awards are...
Blog - Free Flash Slideshow Widget
-
Feb 27, 2009, 09:22 #5
- Join Date
- Oct 2008
- Posts
- 140
- Mentioned
- 4 Post(s)
- Tagged
- 0 Thread(s)
Do you know of a sample php email form that emails the information then forwards to another page without sending the information? I have seen samples but non that use mail cgi and non that clears the information.
-
Mar 6, 2009, 06:19 #6
- Join Date
- Jul 2008
- Posts
- 13
- Mentioned
- 0 Post(s)
- Tagged
- 0 Thread(s)
I have the same situation and am converting from CFM to PHP. Did you ever find anything?
-
Mar 6, 2009, 12:16 #7
- Join Date
- Oct 2008
- Posts
- 140
- Mentioned
- 4 Post(s)
- Tagged
- 0 Thread(s)
Nope, didn't find an example.
Michelle
-
Mar 6, 2009, 12:42 #8
- Join Date
- Jul 2008
- Posts
- 5,757
- Mentioned
- 0 Post(s)
- Tagged
- 0 Thread(s)
Your cgi script is responsible for redirecting and including the subject into the url query string. Ideally, you should modify this script to not do that. Or, just use php to send the email and forget about the cgi script.
Otherwise, you need to either:
Have the form submit to php. php then uses curl to POST the form data to the cgi script. Then php redirects the user.
or
Have the form post to cgi, but redirect to thankyou.php. php then redirects the user once more(to the thank you page). eg
PHP Code:<?php
// thankyou.php
header('Location: http://example.com/foo/thankyou.html');
Bookmarks