Developer Support »

Can the form data can be included in the on-screen 'Thank You' page?  (See more user questions)

Hi

I can give you a pointer for now but it might require some more coding to do
exactly as you wish. I looked at this before when you first asked for it
and I saw that it was not immediately straight-forward.

The build_message() function puts the end of line characters on the end of
the lines for the email. They are "\n" or "\r\n" as appropriate. The
trouble is for HTML you want <br> or <p> but you can't use these for the
email. So one knocks out the other.

Just had a thought. There's a variable in the script, $line_spacing, that
puts the end of line characters in. You can change this before you call the
build_message() function for the "thank you" page. Try this:

$line_spacing = "<br>";

$formdata = build_message($_REQUEST);

$formdata = stripslashes($formdata) ;

Just a point. In the code below you have a period concatenating the
$formdata variable which I have removed in the above code.

I haven't tested this but I think it will work.

Any questions, just let me know.

Best wishes.

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

----- Original Message -----
Sent: Tuesday, June 17, 2008 7:05 AM
Subject: Re: FormToEmail Script


> Hi Charles
>
> Well, my attempts a writing PHP script has not been too successful.
>
> Started off OK and I can get the form data to display in the "Thank you"
> screen by adding a couple of lines to the bottom of your script but all
> the data displays on one line and I can't for the life of me figure out
> how to get each field to display on a separate line (as they do in the
> emails).
>
> I wonder if you have any suggestions - I tried adding various
> combinations of PHP_EOL and \n but to no avail?
>
> Cheers
>
>
> Here's the code that I added to the bottom of your script and the thank
> you screen:
>
> // Redirect or display "thank you" message.
>
> if($auto_redirect){header("location: $redirect_url"); exit;}
>
>
> // To display data in the "thank you" screen
>
> $formdata .= build_message($_REQUEST);
>
> $formdata = stripslashes($formdata) ;
>
> ?>
>
> <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
>
> <html>
>
> <head>
> <title>Thank You</title>
> <meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
> </head>
>
> <body bgcolor="#ffffff" text="#000000">
>
> <div>
> <center>
> <b>Thank you <?php print stripslashes($_REQUEST['name']); ?> for your
> message</b>
> <br>Here is the data that you entered in the form
> <br><?php print $formdata; ?>
> <p><a href="<?php print $continue; ?>">Click here to continue</a></p>
> </center>
> </div>
>
> </body>
> </html>
>
>
>
> -------- Original Message --------
> Subject: Re: FormToEmail Script
> Date: Tuesday, June 10, 2008 00:20:51
>
>> Hi
>>
>> Thanks for the feedback, always appreciated.
>>
>> I had a think about making it an option but I know from experience, If I
>> code it one way, someone will come along and want it done another way.
>> For example, do I use a centred table to display the data? Or a left
>> aligned table? Do I make the field names bold? Do I make the table
>> cells different colours, do I have a border on the table? etc etc etc.
>>
>> This is similar to the HTML output that the script can provide for the
>> email. I get people wanting it a certain way but there is a limit to how
>> customizable you can make it without making it too confusing. A MAJOR
>> part of my product is its simplicity, something I am always aware of.
>> Largely it's inviting trouble to have these things!
>>
>> Don't get me wrong, the HTML ouput for the email is customizable to a
>> degree, fonts, background colours etc.
>>
>> (I'm from Scotland, currently living in London. Have a good night!)
>>
>> Best wishes.
>>
>> Charles Sweeney
>> https://formtoemail.com
>> The world's easiest feedback script!
>>
>> ----- Original Message -----
>> Sent: Monday, June 09, 2008 11:36 AM
>> Subject: Re: FormToEmail Script
>>
>>
>>> Hi Charles
>>>
>>> Thanks again for your helpful reply.
>>>
>>> I am in the process of having to move away from using a very flexible
>>> CGI/perl form which we have steadily developed over the years. There
>>> seems to be "security" bug that I can't fix and I'm getting plagued by
>>> spammers.
>>>
>>> I'm not sure that "thank you" page form data is always desirable but it
>>> would have been nice to have it available.
>>>
>>> As the emails include this feature I am pretty sure that it could be an
>>> option in the "thank you" page and I can probably add it myself when I
>>> get a bit more familiar with PHP programing.
>>>
>>> Otherwise, your PRO script certainly seems to include all the other
>>> features that I am used to having available and I will download it
>>> tomorrow - it's 10.30 pm here in New Zealand.
>>>
>>> Best regards
>>>
>>>
>>> -------- Original Message --------
>>> Subject: Re: FormToEmail Script
>>> Date: Monday, June 09, 2008 20:47:38
>>>
>>>> Hi
>>>>
>>>> Got you.
>>>>
>>>> As far as I can tell there is not a great demand for this. I do
>>>> sometimes get enquiries about including parts of the form (as opposed
>>>> to the whole thing) in a "Thank You" message, like "Thank you for
>>>> booking a trip to Florida" etc.
>>>>
>>>> I suppose I could make it a configurable option but I am always mindful
>>>> of balancing simplicity and ease of use with configuration options. I
>>>> don't want it to appear daunting on first look, i.e configuration
>>>> options the length of your arm. Having said that, it looks like it's
>>>> going that way anyway!
>>>>
>>>> Is there a particular reason why you need this?
>>>>
>>>> Best wishes.
>>>>
>>>> Charles Sweeney
>>>> https://formtoemail.com
>>>> The world's easiest feedback script!
>>>>
>>>> ----- Original Message -----
>>>> Sent: Monday, June 09, 2008 4:37 AM
>>>> Subject: Re: FormToEmail Script
>>>>
>>>>
>>>>> Hi Charles
>>>>>
>>>>> Thanks for your message.
>>>>>
>>>>> I had already worked out that you could do it like that. I was hoping
>>>>> that there was some way to automatically include all the fields in
>>>>> sequence in the thank you page - just as you do in emails sending the
>>>>> form data.
>>>>>
>>>>> Cheers
>>>>>
>>>>>
>>>>> -------- Original Message --------
>>>>> Subject: Re: FormToEmail Script
>>>>> Date: Monday, June 09, 2008 11:03:56
>>>>>
>>>>>> Hi
>>>>>>
>>>>>> Thank you for your question.
>>>>>>
>>>>>> By default the built-in "Thank You" message only shows the name from
>>>>>> the form (assuming the name input field is called "name"). You will
>>>>>> need to code the "Thank You" section of the script to show other
>>>>>> values from the form. The free script and the Pro version both have
>>>>>> the same basic "Thank You" message built in, so you can practise with
>>>>>> the free version first if you prefer. I have attached a copy of it
>>>>>> to this email for your convenience.
>>>>>>
>>>>>> You can see the code for the "Thank You" message at the bottom of the
>>>>>> script. This piece of code displays the name from the form:
>>>>>>
>>>>>> <?php print stripslashes($_REQUEST['name']); ?>
>>>>>>
>>>>>> You can use it to print any value from the form, like a product for
>>>>>> example:
>>>>>>
>>>>>> <?php print stripslashes($_REQUEST['product']); ?>
>>>>>>
>>>>>> So long as you use the exact name for the form field ('product' in
>>>>>> the above example) you can print out any or all of the form fields.
>>>>>> When I say "print", in this case it means displaying them on the
>>>>>> screen in the "Thank You" message.
>>>>>>
>>>>>> Please note, if you are coding this you cannot autoredirect to
>>>>>> another "Thank You" page. You will be using the "Thank You" message
>>>>>> built into the script.
>>>>>>
>>>>>> So you just need to open the script in a text editor and edit the
>>>>>> code at the bottom for the "Thank You" message.
>>>>>>
>>>>>> Alternatively you can enable the autoresponder (Pro version) which
>>>>>> sends an email to the visitor, showing the submitted form data.
>>>>>>
>>>>>> Does this help?
>>>>>>
>>>>>> Any questions, just let me know.
>>>>>>
>>>>>> Best wishes.
>>>>>>
>>>>>> Charles Sweeney
>>>>>> https://formtoemail.com
>>>>>> The world's easiest feedback script!
>>>>>>
>>>>>> ----- Original Message -----
>>>>>> Sent: Sunday, June 08, 2008 10:26 PM
>>>>>> Subject: FormToEmail Script
>>>>>>
>>>>>>
>>>>>>>
>>>>>>> Comments: Hi
>>>>>>>
>>>>>>> I am interested in the pro version of your script but please can you
>>>>>>> advise if the form data can be included in the on-screen "Thank You"
>>>>>>> page?