Reply to Re: when a value passed in form or q'string is empty..

Your name:

Reply:


Posted by ED on 06/13/06 20:48

"maya" <maya778899@yahoo.com> wrote in message
news:448f0765$0$15795$14726298@news.sunsite.dk...
> hello, I am trying to figure out how to deal with when not all elements in
> a submitted form are filled out or when page expects a query string and
> doesn't get one.. I tried the two conditionals below, but still got
> errors:
>
> $param= $_GET['msg'];
>
> /*
> if ($param != "") {
> echo $param;
> }
> */
>
> if (isset($param)) {
> echo $param;
> }
>
>
> query string is:
>
> home.php?msg=selected records have been deleted from the database.
>
> (referrer pg is not always pg sending query string.. so need to deal
> w/when no query string is passed..)
>
> thank you very much..
>
>

try:
if (isset($_GET['msg']) && !empty($_GET['msg'])) {
$param = $_GET['msg'];
//do whatever
}
As an aside you should also be urlencoding the query string values:
home.php?msg=selected+records+have+been+deleted+etc
not
home.php?msg=selected records have been deleted from the database.
(see: http://uk2.php.net/urlencode )

cheers
ED

[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

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