Hi, I am a designer with HTML/CSS/PHP skills but not much Javascript. I was hoping someone could give me some advice on this problem.
[B]Goal:
[B]Research:
[B]Problem:
Also, is there an easy way to write out the cookie contents without the “cookie_name=” part?
[B]Note:
Thanks in advance for any help or suggestions.
[COLOR=”Blue”]Write cookie code:
[CODE]// in Head
<script language=”JavaScript”>
function set_cookie(){
if (document.cookie && document.cookie != “”){
var old_cookie = document.cookie;
var product = (“chair01<br/>”);
document.cookie = old_cookie + escape(product);
}//ends IF
else{
var product = (“chair01”);
document.cookie = “products=<br/>” + escape(product);}
}//ends function
function kill_set_cookie(){
var kill_date = new Date(“January 1, 1970”);
var kill_string = “products=<br />;expires=” + kill_date;
document.cookie = kill_string;
}//ends function
</script>
// end head
// in Body
<a href=”javascript:set_cookie()”>More info</a>
[COLOR=”Blue”]Read cookie code:
[CODE]// in Head
<script language=”JavaScript”>
(document.cookie && document.cookie != “”)
{var whole_cookie = unescape(document.cookie);
}
</script>
// end head
// in Body
<script language=”JavaScript”>document.write(whole_cookie);</script>