Forums

PHP

This topic is locked

Submit Multi-Page PHP Form Then Thank You Page

Posted 02 Mar 2008 21:55:25
1
has voted
02 Mar 2008 21:55:25 Chris Hoffmann posted:
OMG! Need help, i have a multi-page form (employment application) that i need to send to an email then just redirect to a thank you page. It either does one or the other, but won't do both...can anyone help?
Thanks!

Replies

Replied 03 Mar 2008 10:52:36
03 Mar 2008 10:52:36 Alan C replied:
Hi Chris,
very willing to help but you will have to give more information about what is happening etc, maybe the code, so people can have a look and see just what is going on <img src=../images/dmxzone/forum/icon_smile.gif border=0 align=middle>

Edited by - sitemaster on 03 Mar 2008 10:54:49
Replied 07 Mar 2008 05:40:37
07 Mar 2008 05:40:37 Chris Hoffmann replied:
<BLOCKQUOTE id=quote><font size=1 face="Verdana, Arial, Helvetica" id=quote>quote:<hr height=1 noshade id=quote>
Hi Chris,
very willing to help but you will have to give more information about what is happening etc, maybe the code, so people can have a look and see just what is going on <img src=../images/dmxzone/forum/icon_smile.gif border=0 align=middle>

Edited by - sitemaster on 03 Mar 2008 10:54:49
<hr height=1 noshade id=quote></BLOCKQUOTE id=quote></font id=quote><font face="Verdana, Arial, Helvetica" size=2 id=quote>
&lt;head&gt;
&lt;title&gt;Application For Employment Page 5&lt;/title&gt;
&lt;style type="text/css"&gt;
&lt;!--
.style4 { font-size: 18pt;
font-weight: bold;
}
.style5 {font-size: 14pt}
.style1 { font-size: 14pt;
font-weight: bold;
}
.style7 { font-size: 12pt;
font-weight: bold;
}
--&gt;
&lt;/style&gt;
&lt;script type="text/JavaScript"&gt;
&lt;!--
function MM_goToURL() { //v3.0
var i, args=MM_goToURL.arguments; document.MM_returnValue = false;
for (i=0; i&lt;(args.length-1); i+=2) eval(args[i]+".location='"+args[i+1]+"'";
}
//--&gt;
&lt;/script&gt;
&lt;/head&gt;

&lt;body&gt;
&lt;table width="800" border="0" cellpadding="0" cellspacing="0" align="center"&gt;
&lt;!--DWLayoutTable--&gt;
&lt;tr&gt;
&lt;td width="800" height="782" valign="top"&gt;
&lt;form action="www.leewardconstruction.com/securemail.php" method="post" enctype="multipart/form-data" name="Employment Application" id="Application" /&gt;

&lt;input type=hidden name="redirect" value="www.leewardconstruction.com/thankyou.html"&gt;

&lt;?php
foreach($_POST as $key=&gt;$value){
if ($key!="submit"{
$value=htmlentities(stripslashes(strip_tags($value)));
echo "\t&lt;input type=\"hidden\" name=\"$key\" value=\"$value\"&gt;\n";
}
}
?&gt;

&lt;div align="center"&gt;
&lt;p&gt;&lt;img src="../images/leewardlogo.gif" width="349" height="77" /&gt;

that is the top of my form, i want it to go through securemail.php then submit to an email address and then go to a thank you page.... it just goes to the thank you page and doesn't send the email??????? totally confused.....

Replied 07 Mar 2008 14:38:40
07 Mar 2008 14:38:40 Alan C replied:
Hi
Thanks for posting the code, I've not used securemail.php, but I have used formmail, which looks broadly similar - it takes the contents of the form, parses it and sends the email etc.
In your script I don't see any of the other parameters that are needed to set up securemail, I did a quick search on it and found this page . . .

www.isitebuild.com/simplephpform.htm

there are a number of other hidden fields that need to go in there so that securemail knows where to send the email etc, you would need to put them in for it to work - you might already have them but I can't see them

Had a quick look at the site - it's looking good, and that form is quite an undertaking with all those fields
sso you would need at least the recipient in there

another way to handle this, but not quite as easy, is with something like formstogo which will set up the email and do redirects to success or fail, it does a good job but I find I need to modify the code a little sometimes to get just what I want, but then I'm using the free version on an occassional basis


Replied 07 Mar 2008 15:35:58
07 Mar 2008 15:35:58 Chris Hoffmann replied:
Hi Alan,
That is so wierd, that's where I got the code from.... do do do do, anyway, securemail is the same as formmail,(i think) just saved as a different name, because I heard that crawlers don't like the name formmail anymore.... anyway if you go back to that page (www.isitebuild.com/simplephpform.htm) it says that if ($recipient = " , "<img src=../images/dmxzone/forum/icon_smile_wink.gif border=0 align=middle> is entered into the securemail.php form that you don't need the ( &lt;input type=hidden name="recipient" value=" "&gt<img src=../images/dmxzone/forum/icon_smile_wink.gif border=0 align=middle> in the html or in my case the php file. So i left it out. The referrers field is changed to my server info in the securemail.php file and i uploaded it to my root directory. Then this is added to the form (&lt;form name="form mail" method="post"
action="www.ihost-websites.com/securemail.php"&gt<img src=../images/dmxzone/forum/icon_smile_wink.gif border=0 align=middle> as you can see, then it says that the other fields are optional...... so am i getting lost in translation somewhere? the code that i posted is all of it, the rest of it is the form. You checked it out, it is a 5 page form. Everything works perfectly from beginning to almost the end. It carries all of the information over from page to page... i know this because i've tested it by "only" having it send directly to email, so you can see my conundrum.... i've been playing with this for like a week or so now, spending a few hours a night on this.....it's driving me crazy, if you can help me figure this out, i'll send you a box of chocolates...lol

Replied 07 Mar 2008 18:11:41
07 Mar 2008 18:11:41 Chris Hoffmann replied:
Hi Alan,
here's another one for ya, my clients are killing me, is there any way to have the form sent to the email address in pdf format? i have never heard of whether you can or not?

Replied 09 Mar 2008 13:15:54
09 Mar 2008 13:15:54 Alan C replied:
well that's an offer I don't find hard to refuse, of all things I have an allergy to cocoa so never touch chocolate - I'm in the UK at the moment sorting something out so I'm pushed for time, but will be back home tuesday, if I get time I will pick that code apart and see what's happening or not happening

pdf is one I've not come across before for sending emails, but I don't see why it can't be done, I guess there will be a way to generate a pdf, once you do there might be issues with presentation, your client may be looking for specific formatting etc - my maxim is

the client doesn't know what they want; but they know what they don't want when they see it

<img src=../images/dmxzone/forum/icon_smile.gif border=0 align=middle>

Replied 09 Mar 2008 18:00:54
09 Mar 2008 18:00:54 Chris Hoffmann replied:
hahaha sorry! anyway, i figured out the problem, it form works on my personal server, but not the clients, need to do some investigating. They have a server I've never heard of before and when the client called for information, the server had no idea what php was? UNBELIEVABLE! But if you know of a way to generate a pdf, please share!
Thanks for you help!

Replied 10 Mar 2008 00:59:43
10 Mar 2008 00:59:43 Alan C replied:
excellent news that it's sorted out, but that's amazing that the server is the issue, if I come across anything to do the pdf I'll post it.

My guess is that this will not be easy because there is formatting involved to get the text to look right, but there's probably someone somewhere that has done it
Replied 10 Mar 2008 15:11:11
10 Mar 2008 15:11:11 Georgi Kralev replied:
<BLOCKQUOTE id=quote><font size=1 face="Verdana, Arial, Helvetica" id=quote>quote:<hr height=1 noshade id=quote>
hahaha sorry! anyway, i figured out the problem, it form works on my personal server, but not the clients, need to do some investigating. They have a server I've never heard of before and when the client called for information, the server had no idea what php was? UNBELIEVABLE! But if you know of a way to generate a pdf, please share!
Thanks for you help!


<hr height=1 noshade id=quote></BLOCKQUOTE id=quote></font id=quote><font face="Verdana, Arial, Helvetica" size=2 id=quote>

Hi Chris,

For generating PDF files with PHP you can check the following FAQ:
dmxzone.com/ShowDetail.asp?NewsId=14269

I hope that you will find it useful.

Regards,

Georgi Kralev

Homepage: gdkralev.googlepages.com

Reply to this topic