Re: what's the difference in the following code?



Hi,
why say Chris Shiflett that this is not good: because security problems or because you cannot see very good what the code do?.


Regards

Carlos

Lamp Lists schrieb:
I'm reading "Essential PHP Security" by Chris Shiflett.

on the very beginning, page 5 & 6, if I got it correct, he said this is not good:

$search = isset($_GET['search']) ? $_GET['search'] : '';

and this is good:

$search = '';
if (isset($_GET['search']))
{
$search = $_GET['search'];
}

what's the difference? I really can't see?
to me is more the way you like to write your code (and I like the top one :-) )?

thanks.

-ll


__________________________________________________
Do You Yahoo!?
Tired of spam? Yahoo! Mail has the best spam protection around http://mail.yahoo.com
.



Relevant Pages

  • Re: "Designed for FreeBSD" stickers
    ... Regards, ... Do You Yahoo!? ... Mail has the best spam protection around ...
    (freebsd-questions)
  • Re: Stress Tools
    ... > We are running RedHat Enterprise 2.6. ... > Thanks & Regards, ... > Do You Yahoo!? ... Mail has the best spam protection around ...
    (RedHat)
  • Who is eorgan945@uol.com.br?
    ... Best Regards, ... Antonio ... Do You Yahoo!? ... Mail has the best spam protection around ...
    (Fedora)
  • Re: network utilities
    ... Regards. ... Do You Yahoo!? ... Mail has the best spam protection around ...
    (Debian-User)
  • Re: What will you be hunting with this Fall?
    ... > a rear sight and a slightly prouder front sight than ... > add a forward sling loop and a sling button toward the ... > Do You Yahoo!? ... Mail has the best spam protection around ...
    (rec.hunting)