Recent Posts

Step Two

3:19 AM No Comment
Step 2: Inserting Cookies Into a Form Field
Paste this form somewhere below the JavaScript, in the BODY area of the new web page you created in step 1.
Change the action=”___________” to the URL of your form handling program.
The redirect emailtemplate hidden fields are for Master Form V3. If you’re using a different form handling program, use hidden fields your program expects.
<form name="MyForm"
     action="/cgi-bin/MasterFormV3.cgi"
     method="POST">
<input
     type="hidden"
     name="redirect"
     value="/blank.html">
<input
     type="hidden"
     name="emailtemplate"
     value="contact/cookiemail.txt">

<!-- The following writes form hidden field
     name="onecookie" with the value of
     a cookie named "AffiliateCookie" —>
<script type="text/javascript" language="JavaScript"><!--
var acookie = GetCookieByName("AffiliateCookie");
document.write('<input name="onecookie" value="');
document.write(acookie);
document.write('" type="hidden">');
//--></script>

<!-- The following writes form hidden field
     name="allcookies" with the name and
     value of all available cookies. —>
<script type="text/javascript" language="JavaScript"><!--
var cookies = GetAllCookies();
document.write('<input name="allcookies" value="');
document.write(cookies);
document.write('" type="hidden">');
//--></script>

</form>
An HTML comment above each of the two JavaScript sections notes what the JavaScript does. Keep one or both.
If you keep the one that retrieves the value of a cookie named “AffiliateCookie” and writes it into a hidden field, you’ll need to change “AffiliateCookie” in the JavaScript code with the name of the cookie you want to retrieve.
No modifications need to be made to the JavaScript that writes the name and value of all available cookies into a hidden form field.
If you use Master Form V3 —
Here is an example email template you can use with the above form:



To: will@example.com

Subject: Cookie enclosed

AffiliateCookie cookie: [[onecookie]]
All cookies —
[[allcookies]]

No comments :

 

Website | The content is copyright. © | All Rights Reserved 2011

Blogger template by PSpice