if statement with or comparison (newbie)

This is a discussion on if statement with or comparison (newbie) within the PHP General forums, part of the PHP Programming Forums category; At 12:29 PM -0400 9/9/06, Robert Cummings wrote: >On Sat, 2006-09-09 at 12:12 -...


Go Back   Usenet Forums > PHP Programming Forums > PHP General

FAQ Members List Calendar Search Today's Posts Mark Forums Read
  #21 (permalink)  
Old 09-09-2006
tedd
 
Posts: n/a
Default Re: [PHP] if statement with or comparison (newbie)

At 12:29 PM -0400 9/9/06, Robert Cummings wrote:
>On Sat, 2006-09-09 at 12:12 -0400, Mark Charette wrote:
>>
>> As a senior member of the software QC department in a major industrial
>> company, I generally find more errors and omissions in validation
>> routines during code reviews and ethical hacks than anywhere else.

>
>http://en.wikipedia.org/wiki/Appeal_to_authority
>
>Where's Tedd, he's got the latin to go with the above link >:)
>
>Cheers,
>Rob.


Rob:

Don't throw me in that briar patch. I know the
saying "Locus ab auctoritate est infirmissimus"
may appear to fit, but I think in this case "se
méfier de l'eau qui dort" is better.

Besides:

A) I was the one that started this fire storm.

B) Mark came in and backed me up.

C) Stu, who respect greatly, surprisingly waded in on the other side.

Now, I stand cowardly between two opinions not
wanting to offend either, nor embarrass myself
publicly, which I do often enough anyway.

However with that said, my original question/statement still stands.

I realize (AS WE ALL DO), that *all* data coming
from outside *must* be sanitized -- BUT -- using
$_REQUEST still does not provide as much
information as to where the data came from as the
use of $_GET, $_POST, and $_COOKIE -- that's an
unarguable fact, is it not?

This thread was like an old-west circled wagon
train with everyone inside expounding about the
obvious dangers of an Indian attack* but failing
to listen to some who are saying "They're
attacking from the West", while arguing it's not
important to know which way the attack comes. I
think some just misread the point of the post.

tedd (as he scurries around to the east side of a rock while dodging arrows)

*In keeping with current Political correctness,
it was an US "Indian" attack -- also note the
attack was from the West and not from the East.
:-)

--
-------
http://sperling.com http://ancientstones.com http://earthstones.com
Reply With Quote
  #22 (permalink)  
Old 09-11-2006
Curt Zirzow
 
Posts: n/a
Default Re: [PHP] if statement with or comparison (newbie)

On 9/8/06, Robert Cummings <robert@interjinn.com> wrote:
> On Fri, 2006-09-08 at 15:30 -0600, Jeremy Privett wrote:
> > Well, it could be this, too:
> >
> > switch( $_REQUEST['id'] ) {
> > case "white":
> > echo "Right color.";
> > break;
> >
> > case "black":
> > echo "Right color.";
> > break;
> >
> > default:
> > echo "Wrong color.";
> > break;
> > }

>
> Ugh, if you're going to use a big ugly case statement for something so
> trivial at least make use of the fall-through feature:
>
> <?php
> switch( $_REQUEST['id'] )
> {
> case 'white':
> case 'black':
> {
> echo 'Right color.';
> break;
> }


I don't know about big and ugly, it seems more clear on what is going
on in this situation. But yeah it is best to clearify the switch as
you rewrote it.

curt.
Reply With Quote
Reply
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are Off
[IMG] code is Off
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On



All times are GMT +1. The time now is 06:13 AM.


Powered by vBulletin® Version 3.7.3
Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.
Content Relevant URLs by vBSEO 3.0.0