Posted by Jerry Stuckle on 03/26/07 18:51
Lo'oris wrote:
> $name=$_GET['name'];
> if (!$name)
> $name="value";
>
> i can't figure out how to shorten this thing. Is there some kind of
> operator i don't know about?
>
$name = isset($_GET['name']) ? $_GET['name'] : null;
You should always test with isset() to see if a value passed to your
page is set or not. Otherwise you will get a notice if you have them
enabled.
--
==================
Remove the "x" from my email address
Jerry Stuckle
JDS Computer Training Corp.
jstucklex@attglobal.net
==================
[Back to original message]
|