Reply to Re: find a cookie by part of it's name

Your name:

Reply:


Posted by Andy Jeffries on 05/09/06 11:27

On Mon, 08 May 2006 20:53:38 -0400, Ron Croonenberg wrote:
> Hi all,
>
> cookies are stored in an array called $HTTP_COOKIE_VARS right ?

$_COOKIE is better.

> Is it possible to find a cookie if you know part of it's name ?
>
> For example the cookiename is firstname and I want to check all cookies
> that start with "first" in there name.
>
> I tried to work wih string and substrings, but that didn't seem
> to work ?

The answer is easy, but this is sounding a bit like homework... Post the
code you have and we'll help more.

As a hint, use foreach to iterate the $_COOKIE array, look at the key for
each item and compare it using either substr or regular expressions.

That should have given you enough terms to Google your way through it.

Cheers,


Andy


--
Andy Jeffries MBCS CITP ZCE | gPHPEdit Lead Developer
http://www.gphpedit.org | PHP editor for Gnome 2
http://www.andyjeffries.co.uk | Personal site and photos

[Back to original 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

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