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 ( [EMAIL PROTECTED] )

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" <[EMAIL PROTECTED]>
To: <[EMAIL PROTECTED]>
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: [EMAIL PROTECTED]
> For additional commands, e-mail: [EMAIL PROTECTED]
> To contact the list administrators, e-mail: [EMAIL PROTECTED]
>
>


-- 
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]

Reply via email to