View Full Version : formmail.php
VonErichLives
11-05-2009, 10:42 PM
ok, working on a site... the form works, hit submit and the info gets e-mailed.
Problem is, it doesn't go to my thankyou.html page...
where/how in the formmail.php file do I put the redirect?
I thought it was
input type="hidden" name="redirect" value="http://your.host/to/file.html"
but that doesn't seem to work.
Triple A
11-06-2009, 06:38 AM
Yeah, that's right.
Check to see if you mistyped any quotation marks or something. Also I don't think it should make a difference but try removing the quotes around "hidden." If you want, email me all the code in a text document or something and I will check it out.
VonErichLives
11-06-2009, 06:49 PM
no mitypes... is there a certain place in the php file I need to put it?
Triple A
11-06-2009, 08:12 PM
Oh... no, that part goes on the HTML page where you are putting the form.
If you are using a pre-made PHP formmail script, you shouldn't need to edit anything in there.
In the html you would put something like
<</>form action="http://www.yourhost.com/formmail.php" method=post>
<</>input type=hidden name="recipient" value="email@your.host.com">
<</>input type=hidden name="subject" value="subject">
<</>input type=text name="body">
<</>input type=hidden name="redirect" value="http://your.host/to/file.html">
<</>/form>
I am leaving out a bunch of stuff like the submit button, etc. but that is just an example.
http://www.dtheatre.com/scripts/formmail_doc.php
VonErichLives
11-06-2009, 08:21 PM
ahh, ok that was my mistake... I need to put the redirect in the form before I close the form... I'll try that.
thank you!
VonErichLives
11-07-2009, 11:53 AM
ok, still not working... I've added it after the submit button, in the form, outside the form... and no luck... still every time you hit submit it gets the "thank you" message from the .php file instead of the redirect.
Triple A
11-07-2009, 12:19 PM
It needs to be before the submit button line and in the form.
VonErichLives
11-07-2009, 12:38 PM
still no luck..
here's what I have where the submit is:
<td colspan="3"> </td>
<td colspan="3"> </td>
<td><div align="center"><span class="Tahoma">
<input name="Submit" type="submit" class="Tahoma" id="Submit" value="Submit"/>
</span></div></td>
<td><div align="center"><span class="Tahoma">
<input name="Clear" type="reset" class="Tahoma" id="Clear" value="Clear" />
</span></div></td>
<td> </td>
Where in there should the redirect be?
I tried a meta tag and that works but it redirects before you even submit...
The ideal situation would be to have the redirect in the php file because I have like 7 different forms that go to this php file, so it would be better to have the redirect there instead of in each page.
But when I put the meta tag in the php file, all I get is it still goes to the php file but just give a blank page, no redirect or the normal message.
VonErichLives
11-07-2009, 12:56 PM
YESSSSSSS! FOUND IT! DONE!
Got a php redirect code in the php!!!!
WOOOOOOOOOOOOOOOOOOOOOOOOO!
vBulletin® v3.8.7, Copyright ©2000-2025, vBulletin Solutions, Inc.