DEFAULT PERSONALIZED SUCCESS PAGE
There are two types of Personalized Success Pages. One if you are using the MySQL database and the other is not dependant on any database..
This section covers the personalized success page that is not dependant on a database.
IMPORTANT SECURITY NOTICE: It is not wise to post sensitive information such
as social secuity or credit card numbers on this success page.
About ENVOLOPE Get Method (for beginners)
For beginners here is a quick lesson in URL "GET Envelope" information.
URL Envelope "GET" is a way to pass variables from one page to another.
This can be done by the <form method="GET"> or simply by entering variables at the end of a url after a "?".
For an example follow the below steps:
1. add a ? after the page extension.
(This shows the browser that anything after the ? is going to be a GET variable)
Example: http://www.yourdomain.com/cgi-bin/success.cgi?
2. Add variable names and values. To do this simply add: name=value
Example: http://www.yourdomain.com/cgi-bin/success.cgi?name=value
3. To add more variables in addition to the first variable added; Simply add: &name2=value2
( The & sign separates each name and value. To add more simply keep following step 3.
Example: http://www.yourdomain.com/cgi-bin/success.cgi?name=value&name2=value2&name3=value3
Personalizing the General Success Page
The first step in personalizing your success page is to set success.cgi as your success page
in the hidden field on your HTML form.
The "success_page" hidden field should look something like this:
<input type="hidden" name="success_page" value="http://www.yourdomain.com/cgi-bin/success.cgi?p=1&firstname={firstname}&lastname={lastname}">
In the above example you will need to replace yourdomain.com with your actualy web sites domain name.
NOTE: In the above example p=1, refers to the HTML SUCCESS PAGE TEMPLATE being used.
This will be explained latter in this explanation.
For every field used in your HTML form there is a proportionally corresponding & joined personalization TAG.
What ever the field name="", the personalization TAG used in the success url is the same with added {} brackets around the field name.
ie. {FIELD_NAME}
These tags are case sensitive.
So for example if you had the below form field:
<input type="text" name="firstname">
{firstname} - would be the personalization tag for this field
IMPORTANT NOTE: Since the personalization tag is case sensitve, using {FIRSTNAME} as the personalization
tag in this example will not work.
Continuing with the example; If "Joe" is the value entered in this field name="firstname"
firstname={firstname}
WOULD translate to:
firstname=Joe
OTHER EXAMPLES:
<input type="text" name="First_Name"> Personalization TAG would be: {First_Name}
<input type="text" name="email"> Personalization TAG would be: {email}
<input type="text" name="PHONE"> Personalization TAG would be: {PHONE}
ETC...
YOU WILL THEN TAKE THIS INFORMATION PASSED AND EXTRACT IT ONTO YOUR SUCCESS HTML TEMPLATE WHICH WILL BE EXPLAINED LATER IN THIS README.
Using ENVOLOPE Get Method with the General Success Page
To implement this SUCCESS PAGE MODULE you add the below hidden field into your HTML form. (as explained above)
<input type="hidden" name="success_page" value="http://www.yourdomain.com/cgi-bin/success.cgi?p=1&firstname={firstname}&lastname={lastname}&field3={field3}&etc={etc}">
Breaking it down after the ?
1. p=1
The number after the = sign will be the HTML success page template success.cgi will use.
(This is configured in the success.cgi script.)
(AFTER EVERY VARIABLE THERE SHOULD BE AN "&" SIGN THAT WILL PRECEED THE NEXT VARIABLE AS SHOWN IN THE EXAMPLE ABOVE)
So if you have form fields: firstname, lastname, field3 AND etc
You would implement these fields into the success url as shown below.
2. YOU WOULD ADD
&firstname={firstname}
http://www.yourdomain.com/cgi-bin/success.cgi?p=1&firstname={firstname}
{firstname} will equal the value entered by the form poster into the name="firstname" field on your HTML form.
3. YOU WOULD ADD
&lastname={lastname}
http://www.yourdomain.com/cgi-bin/success.cgi?p=1&firstname={firstname}&lastname={lastname}
{lastname} will equal the value entered by the form poster into the name="lastname" field on your HTML form.
4. YOU WOULD ADD
&field3={field3}
http://www.yourdomain.com/cgi-bin/success.cgi?p=1&firstname={firstname}&lastname={lastname}&field3={field3}
{field3} will equal the value entered by the form poster into the name="field3" field on your HTML form.
5. YOU WOULD ADD
&etc={etc}
http://www.yourdomain.com/cgi-bin/success.cgi?p=1&firstname={firstname}&lastname={lastname}&field3={field3}&etc={etc}
{etc} will equal the value entered by the form poster into the name="etc" field on your HTML form.
ETC...
Using ENVOLOPE Get Method with the General Success Page
To personalize your HTML success template page using the ENVOLOPE GET INFORMATION:
1. Open the success.html HTML TEMPLATE file -OR- Open the HTML TEMPLATE success page you created.
2. Personalize.
To personalize simply add the following (proportionally Corresponding) <%ENVOLOPE_NAME%> PERSONALIZATION TAGS
Example: If "Joe" was entered into the HTML form field <input type="text" name="firstname">
AND YOU ADD &firstname={firstname} TO THE SUCCESS URL
&firstname={firstname} WOULD TRANSLATE TO &firstname=Joe
TO Pull the variable value "Joe" onto the HTML success page template simply use: <%firstname%>
3. The tag <%ENVOLOPE_NAME%> will (proportionally) work for every variable after the ?
which follows the success.cgi?
So for example if you had the below URL as the value in the <input type="hidden" name="success_page"> field.
Example: <input type="hidden" name="success_page" value="http://www.yourdomain.com/cgi-bin/success.cgi?p=1&firstname={firstname}&lastname={lastname}&field3={field3}">
The HTML Success page personalization tag
<%firstname%> "WOULD EQUAL" {firstname}
<%lastname%> "WOULD EQUAL" {lastname}
<%field3%> "WOULD EQUAL" {field3}
ETC....
So in laymen’s terms each ENVOLOPE GET NAME HAS A CORESPONDING <%ENVOLOPE_NAME%> TAG
THAT CAN BE USED TO PERSONALIZE THE HTML SUCCESS PAGE.
SO IN THE ABOVE EXAMPLE:
1. {firstname} would pull the value that was entered into <input type="text" name="firstname"> on the HTML form page.
To pull the value use <%firstname%> in the success.html HTML TEMPLATE page.
2. {lastname} would pull the value that was entered into <input type="text" name="lastname"> on the HTML form page.
To pull the value use <%lastname%> in the success.html HTML TEMPLATE page.
3. {field3} would pull the value that was entered into <input type="text" name="field3"> on the HTML form page.
To pull the value use <%field3%> in the success.html HTML TEMPLATE page.
You can have as many different HTML success page templates as you would like.
The way the success.cgi script is set up is simple.
1. You either edit the existing success.html HTML TEMPLATE or create your own HTML success page template.
2. For each HTML TEMPLATE success page that is created you must edit the success.cgi script to
list all the success pages that you may want to use.
(More documentation is found on this below and in The success.cgi script.)
3. When you run the success.cgi page it will access the HTML TEMPLATE success page you specified.
(This is specified through the ?p=[PAGE_NUMBER]
with [PAGE_NUMBER] being replaced by the corresponding page setup in success.cgi)
4. You can also personalize each HTML TEMPLATE success page. You can read about this ABOVE for more information.
5. ALL YOUR HTML TEMPLATE SUCCESS PAGES should be uploaded into the same directory as the success.cgi which is usually your cgi-bin.
Editing success.cgi
1. Make sure the top line the "path to Perl" is correct.
ex: #!/usr/bin/perl
If you are not sure check with either your web host or systems administrator.
2. List all the HTML TEMPLATE success pages you may want to use.
$success_file{"1"} = "success.html";
$success_file{"2"} = "success2.html";
$success_file{"3"} = "success3.html";
$success_file{"1"} refers to HTML TEMPLATE success page that the CGI script success.cgi
should access. You can use multiple HTML TEMPLATE success pages for multiple forms. To add more HTML TEMPLATE success
pages simply add the line:
$success_file{"2"} = "success2.html";
-OR-
$success_file{"3"} = "success3.html";
-OR-
$success_file{"4"} = "success4.html";
AND SO ON..... 5, 6, 7, ETC... Corresponding proportionally
To access this page simply change the variable used to call the Corresponding PAGE NUMBER SELECTED IN THE URL WHICH IS SET IN THE HIDDEN FORM FIELD "success_page" AS EXPLAINED ABOVE
EXAMPLE: p=1
Set: success.cgi?p=1
WOULD USE THE SUCCESS HTML TEMPLATE PAGE COFIGURED ON
$success_file{"1"} = "success.html";
-OR-
ANOTHER EXAMPLE: p=2
Set: success.cgi?p=2
WOULD USE THE SUCCESS HTML TEMPLATE PAGE COFIGURED ON
$success_file{"2"} = "success2.html";
-OR-
ANOTHER EXAMPLE: p=3
Set: success.cgi?p=3
WOULD USE THE SUCCESS HTML TEMPLATE PAGE COFIGURED ON
$success_file{"3"} = "success2.html";
ETC......
KEYS TO REMEMBER.
1. The HTML TEMPLATE success pages are not like all the other .html pages.
You MUST upload all of them to the same directory as your success.cgi page. (This will usually be the cgi-bin)
2. YOU WILL NOT CALL THE success.html HTML TEMPLATE page.
Rather you will call the success.cgi page, which in turn calls the success.html page.
3. The success.cgi script must be uploaded to a cgi-bin directory and CHOMED to 755.
Permissions 755 is:
Owner: read, write, execute
Group: read, --- , execute
World: read, --- , execute