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