Re: Must Have Cookies. PHP/JavaScript

From: Date: Thu, 05 Jul 2001 22:03:47 +0000
Subject: Re: Must Have Cookies. PHP/JavaScript
References: 1  Groups: php.general 
Request: Send a blank email to php-general+get-56395@lists.php.net to get a copy of this message
Not to sound overly obvious, but try this. setcookie("cookieusername","$username",time()+6048000,"/","",0); $cookieusername = $HTTP_COOKIE_VARS["cookieusername"]; if (!$cookieusername){ echo"Sorry, no cookie, no page."; die(); } =- Jonathan Campbell ( healsdata@yahoo.com ) Mid days haze and I'm still not awake I got everything going but my bills are still late Funnier than hell and I think it's a blast Life's like a laugh when you got no money Lyrics from "Average Day" by Aztek Trip ( http://www.aztektrip.com ) ----- Original Message ----- From: "Jeff Gannaway" <webmaster@cactusgraphics.com> To: <php-general@lists.php.net> Sent: Thursday, July 05, 2001 4:36 PM Subject: [PHP] Must Have Cookies. PHP/JavaScript > OK, I'm working on a site that absolutely must use a cookie containing a > session identifier. > > 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." > > Does anyone know how to do this with PHP, Java, or JavaScript? > > Code examples or example URLs would be appreciated. > > Thanks, > Jeff Gannaway > ___________________________________________________________ > > SUMMER ART PRINT SALE at www.PopStreet.com > Save an additional 10% off art print orders of $50 or more. > Type in coupon code jemc when checking out. > ___________________________________________________________ > > Find the right art print for your home. > * Search by artist, color, art style and subject. > * Preview the art prints against your wall color. > * Specializing in contemporary, abstract and African > American art. > * Every day discounts on thousands of fine art prints. > > PopStreet.com is your avenue to art. > > > http://www.popstreet.com > ___________________________________________________________ > Coupon may be redeemed from June 27 through July 31, 2001. > > -- > PHP General Mailing List (http://www.php.net/) > To unsubscribe, e-mail: php-general-unsubscribe@lists.php.net > For additional commands, e-mail: php-general-help@lists.php.net > To contact the list administrators, e-mail: php-list-admin@lists.php.net > >

« previous php.general (#56395) next »