[PHP-DB] Getting info from Cookie

2001-08-15 Thread Cato Larsen

Hi!
How can you extract a certain form of info from a Cookie?

Im my case the cookie name is crispy. It has been stored with a session id
and a charnick.

How do I extract the charnick and use it in the page as $charnick or
similar?

Best Regards

Cato Larsen



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




Re: [PHP-DB] Getting info from Cookie

2001-08-15 Thread hassan el forkani


$http_cookie_vars['name_of_cookie']

At 09:57 15/08/01, Cato Larsen wrote:
Hi!
How can you extract a certain form of info from a Cookie?

Im my case the cookie name is crispy. It has been stored with a session id
and a charnick.

How do I extract the charnick and use it in the page as $charnick or
similar?

Best Regards

Cato Larsen



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




Re: [PHP-DB] Getting info from Cookie

2001-08-15 Thread Cato Larsen

Thanks!
But how do you extract a certain point of info from it?

The info is seperated by + (without the 's)

I used:
?php echo $HTTP_COOKIE_VARS[TestCookie]; ?

And I got  Cato+bec39d1ca1091da20b4a8ef5ecacfde8

Where  bec39d1ca1091da20b4a8ef5ecacfde8 is the session id for the MySQL
database, and Cato is what I want to extract.


Cato



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




Re: [PHP-DB] Getting info from Cookie

2001-08-15 Thread Jason Wong

- Original Message -
From: Cato Larsen [EMAIL PROTECTED]
To: [EMAIL PROTECTED]
Sent: Wednesday, August 15, 2001 9:03 PM
Subject: Re: [PHP-DB] Getting info from Cookie


 Thanks!
 But how do you extract a certain point of info from it?

 The info is seperated by + (without the 's)

 I used:
 ?php echo $HTTP_COOKIE_VARS[TestCookie]; ?

 And I got  Cato+bec39d1ca1091da20b4a8ef5ecacfde8

 Where  bec39d1ca1091da20b4a8ef5ecacfde8 is the session id for the MySQL
 database, and Cato is what I want to extract.


Use explode() to split the string using +. This returns an array with 2
elements and in your case you want the first element.

$parts = explode(+, $HTTP_COOKIE_VARS[TestCookie]);
echo $parts[0]


regards
--
Jason Wong
Gremlins Associates
www.gremlins.com.hk




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