digging, I found an excellent solution to my problem that I thought I'd share:
Problem: Want to set a cookie then test for it on the same page. I don't
want to to do page redirection to ensure optimal search engine friendliness.
Code example below:
if (! $MySession)
$SessionID = "2001 A Space Odyssey";
< h t m l > <!--html tag done that way to ensure non-HTML appearance in e-mail
cookie_name = "MySession";
index = document.cookie.indexOf(cookie_name);
if (index != -1)
namestart = (document.cookie.indexOf("=", index) + 1);
nameend = document.cookie.indexOf(";", index);
if (nameend == -1)
nameend = document.cookie.length;
Session = document.cookie.substring(namestart, nameend);
CookieMessage = "Cookies are not enabled. You can browse the site, but
will need to enable them to be able make a purchase."
CookieMessage = ""
blah, blah, blah, the rest of the web page...
At 03:36 PM 7/5/01 -0500, Jeff Gannaway wrote:
>OK, I'm working on a site that absolutely must use a cookie containing a
>I know how to set a cookie through PHP, but I need to do something else too.
>The same page MUST identifier whether the cookie was accepted or not. I've
>seen sites like NetFlix.com that will test to see if their cookie was
>accepted, and if not, print up a page that says "Sorry, you've got have
>your Cookies on or go somewhere else."
PHP General Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]