Pekesan wrote:
> 
> Does anyone know how to detect if the client browser allows cookies or not?
> 
> Thanks in advance.........

Here's one way to do that
(This is from 'Professional PHP Programming' published by Wrox Press):

Step 1: 
  - send a set-cookie request
  - reload current page

Step 2:
  - check whether set-cookie request was successful

<code>

if (empty($check)) {
    $page = "$PHP_SELF?check=1";
    header("Location: $page");
    setcookie("testcookie", "1");
} else {
    if (empty($testcookie)) {
        echo "Could not set test cookie. You browser has disabled
cookies support.";
    } else {
        echo "Your browser supports cookies
    }
}

</code>

Hope that helps. ;)

-- 
Dmitri Zakharov
email: [EMAIL PROTECTED]
phone: (514)938-7389

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