Developer Support »

Using a template for the 'thank you' message, email and autoresponse. Pre-populating the form, showing errors on the form page  (See more user questions)

Hi

You're almost there! Your script configuration is ok but your template
files aren't right. Plus I am a little confused because I have two URLs for
your form page.

The "thank you" message template first (thank_you_message_template.php).
Just write it as a NORMAL HTML file. You have this PHP code in it:

<?php

session_start();

if(isset($_SESSION['submitted_form_values'])){extract($_SESSION['submitted_form_values']);}

?>

That doesn't go in the template. That is the code to pre-populate the form.
It goes on the form page. I have removed it from your
thank_you_message_template.php file and attached the file to this email for
you. Don't put any PHP code in the template file (I know it has a .php
extension but that's for other reasons).

You are not using the correct method to show submitted form values in either
of your template files. You need to use:

ff<field_name>

...so to show the name, you need:

ff<name>

...you have:

<name>

I have changed this in the attached "thank you" message template for you.

About your email template, email_template.php. Same thing as above with
ff<name>. You should try not to use doctypes and CSS in email templates.
This is because email programs have poor support for them (see the article
in my support section, linked below).

About your form. You have these enabled in the script:

$pre_populate_form = 1;

$show_errors_on_form_page = 1;

To pre-populate the form and show errors on the form, the form needs to be a
PHP page, but you gave me this URL:

http://www.example.com/Form/OnlineQuoteRequestForm2.html

...which isn't a PHP page, which means the form won't pre-populate and the
errors won't show on it. In the script you have this as the form page:

$form_page_url = "http://www.example.com/Form/test.php";

Which is the form page?

To code the form page to show the errors and to pre-populate it with
submitted form values in the event of returning to the form after an error,
have a look at the items on my support section, linked below.

For the autoresponse to the visitor. $autoresponse_email_template needs to
be enabled if you are using a template for the autoresponse, like so:

$autoresponse_email_template = 1;

You don't need to use a template for the autoresponse. By default it will
show the submitted form data, so you might want to disable the template at
first, like so:

$autoresponse_email_template = 0;

All the above info is in the script instructions and on the support section,
here:

https://formtoemail.com/developersupport/pre_populate_form.php

https://formtoemail.com/developersupport/show_errors_on_form_page.php

https://formtoemail.com/developersupport/email_templates.php

Try to get the templates working first, before pre-populating the form and
showing the errors on the form page. Don't want to overload yourself.

Any questions, just let me know.

Best wishes.

Charles Sweeney
https://formtoemail.com
The world's easiest feedback script!

----- Original Message -----
Sent: Tuesday, April 13, 2010 8:53 PM
Subject: RE: FormToEmail-Pro script

> Thanks Charles for responding.
> See attached for the scripts and template pages.
>
>
> The ultimate goals that we are looking for:
>
> 1. web visitor fills out form
> 2. web visitor hits submit
> 3. web visitor is presented with a custom thank you page w/results of form
> 4. web visitor gets custom email w/form results
> 5. my clients' company gets custom HTML email of form results
>
>
> Sincerely,
>
> -----Original Message-----
> Sent: Tuesday, April 13, 2010 12:14 PM
> Subject: Re: FormToEmail-Pro script
>
> Hi
>
> Thanks for emailing. I wasn't able to reply to you through the feedback
> board.
>
> I can't really add much to the information I have in the script
> instructions and on my support section. If you attach your script
> (formtoemailpro.php)
> and your template (thank_you_message_template.php) I will have a look at
> them for you.
>
> Just to confirm. You want a custom "thank you" message to be displayed
> when the visitor successfully submits the form?
>
> Best wishes.
>
> Charles Sweeney
> https://formtoemail.com
> The world's easiest feedback script!
>
> ----- Original Message -----
> Sent: Tuesday, April 13, 2010 8:05 PM
> Subject: FormToEmail script
>
>
>> Comments: Hi Charles,
>> We have purchased the form to email pro multiple licenses
>> from your site.
>>
>> I have a few questions that I am hoping you may be able to assist me
>> with.
>>
>> I am able to get the form mail to work using the form script that came
>> inside of the instructions.
>>
>> I can get it to email the results to the submitter with the standard
>> email
>
>> txt in a formatted 2 column table as programmed in the script however I
>> want it to return a customized HTML page.
>>
>> I engaged the following 2 lines in the script page to accommodate this as
>> suggested.
>> $thank_you_message_template = 1;
>> $thank_you_message_template_filename = "thank_you_message_template.php";
>>
>> All scripts and .php files are in the same folder
>>
>> After I hit submit I do get the thank you page but no results are on it>
>>
>> I have put the PHP code at the top of the thank_you_message_template.php
>> as suggested. Please see the page code below.
>>
>> Do I have the php code in the correct place? Also I have tried to use the
>> ff<form_field> to get the results to show up on the but no results are
>> showing.
>>
>> Any advice will be greatly appreciated.
>> You can view the form at:
>> http://www.example.com/Form/OnlineQuoteRequestForm2.html
>> Thanks