You are here: Re: Newbie - Notice:Undefined index: « All PHP « IT news, forums, messages
Re: Newbie - Notice:Undefined index:

Posted by Good Man on 06/14/05 18:13

"Joseph Melnick" <jmelnick@jphp.com> wrote in
news:U-udnXX38YCZVTPfRVn-rA@rogers.com:

> Hello Darren,
>
> I think that the offending line Is the If statement below as
> $_GET["cat_id"] may not exist:
> if ( $_GET["cat_id"] == "$cat_id") {
>
> to fix this you could use a statement like th one below.
> if (array_key_exists("cat_id",$_GET) and $_GET["cat_id"] ==
> "$cat_id") {
>
> Cheers


or, quite simply:

@$cat_id = $_GET['cat_id']; // @ surpresses the error if it doesnt exist

if ($cat_id=="") { //$cat_id was not set

}

 

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

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