boompop — 2011-01-21T11:44:28-05:00 — #1
I have an embedded video set in an iFrame (the page is called on.php). When someone clicks the stop video button, the iframe is re-directed to off.php, and the video is replaced with a play video button -- which when clicked takes them back to the video (on.php).
What I want to do is install a cookie that will permanently 'remember' which page the user has selected (on.php or off.php)... and then from that point forward will always load the appropriate page.
I've seen all sorts of tutorials about setting cookies and stuff, but nothing that would clue me in on how to accomplish what I'm trying to do specifically.
Hoping someone can help.
boompop — 2011-01-24T17:22:28-05:00 — #2
Hmmm... nobody has any ideas?
Based on code in the <head> I'm not sure how (or if) it's pulling the correct URL.
Anyone care to take a stab at it? Or share some pointers?
c_start=document.cookie.indexOf(c_name + "=");
c_start=c_start + c_name.length+1;
if (c_end==-1) c_end=document.cookie.length;
var exdate=new Date();
document.cookie=c_name+ "=" +escape(value)+
((expiredays==null) ? "" : ";expires="+exdate.toUTCString());
<iframe src="<script>getCookie(url);</script>" extrastuff="here" onchange="setCookie(url,this.src,1"></iframe>
boompop — 2011-01-28T11:23:51-05:00 — #3
Last try before the weekend.
Anyone have any pointers RE: the above code?
Or even better... anyone ever solve this problem before? I'd love to get my hands on a solution.