I am working on a email form in HTML that does a POST to a PHP script. I have a JAVA script on the confirmation page that sets a cookie with 2 pieces of information that i need to pull from the information the user submitted. How do I pull the PHP information into the JAVA Script? Here is what the programmer provided me: (scroll down to see where he tells me to imput the code)
function FixCookieDate (date) {
var base = new Date(0);
var skew = base.getTime(); // dawn of (Unix) time - should be 0
if (skew > 0) // Except on the Mac - ahead of its time
date.setTime (date.getTime() - skew);
}
// SetCookie (myCookieVar, cookieValueVar, null, "/myPath", null, true);
//
function SetCookie (name,value,expires,path,domain,secure) {
document.cookie = name + "=" + escape (value) +
((expires) ? "; expires=" + expires.toGMTString() : "") +
((path) ? "; path=" + path : "") +
((domain) ? "; domain=" + domain : "") +
((secure) ? "; secure" : "");
}
var expdate = new Date ();
FixCookieDate (expdate); // Correct for Mac date bug - call only once for given Date object!
expdate.setTime (expdate.getTime() + (90 (24 60 60 1000))); // 90 X 24hr = 90 days from now
// Brian, here's where PHP would need to substitute real values to set the cookie properly
// for email and prodCode values. If only email, then get rid of the "&" and everything after
SetCookie ("hmt", "email=myemailaddress@hiddenmind.com&prodCode=001", expdate);
//document.write ("hmt: " + GetCookie("hmt") + "<br>");
// end script -->