You are here: Re: find a cookie by part of it's name « PHP Programming Language « IT news, forums, messages
Re: find a cookie by part of it's name

Posted by Erwin Moller on 05/09/06 11:14

Ron Croonenberg wrote:

> Hi all,

Hi,

>
> cookies are stored in an array called $HTTP_COOKIE_VARS right ?

Sometimes, it is an 'old' array, possibly not available in future version of
PHP.

Use $_COOKIE instead if you can.

read more here:
http://nl3.php.net/manual/en/reserved.variables.php#reserved.variables.cookies

>
> Is it possible to find a cookie if you know part of it's name ?

Yes.
Try this:

<pre>
<?php print_r($_COOKIE); ?>
</pre>

That will output to html, nicely formatted, what is in the cookiestring the
clientbrowser send along the request to your page.

>
> For example the cookiename is firstname and I want to check all
> cookies that start with "first" in there name.

Just examine the output of the above, and you'll figure out a way to search
for substrings. If not, come back here with some samplecode.

>
> I tried to work wih string and substrings, but that didn't seem
> to work ?

Show us what you tried, along with the content of $_COOKIE your script
received.

Regards,
Erwin Moller

 

Navigation:

[Reply to this message]


Удаленная работа для программистов  •  Как заработать на Google AdSense  •  England, UK  •  статьи на английском  •  PHP MySQL CMS Apache Oscommerce  •  Online Business Knowledge Base  •  DVD MP3 AVI MP4 players codecs conversion help
Home  •  Search  •  Site Map  •  Set as Homepage  •  Add to Favourites

Copyright © 2005-2006 Powered by Custom PHP Programming

Сайт изготовлен в Студии Валентина Петручека
изготовление и поддержка веб-сайтов, разработка программного обеспечения, поисковая оптимизация