Re: alzheimers and confused

From: Date: Sun, 18 Nov 2001 23:38:38 +0000
Subject: Re: alzheimers and confused
References: 1  Groups: php.general 
Request: Send a blank email to php-general+get-75043@lists.php.net to get a copy of this message
if(!eregi("\.jpg$",$image) || !eregi("\.jpeg$",$image)) die("ERROR: doesn't appear to be a JPeg image!"); --Joe On Fri, Nov 16, 2001 at 09:45:07PM -0500, jtjohnston wrote: > OK kids, I'm not 19 ... my old brain gets tired easily and my wife is > complaining that I stay up too late PHPing :) > Putting the rest aside, why does AND work and not OR. OR was what I > meant? > I meant ... if the string doesn't contain .jpg or the string doesn't > contain .jpeg ... > ERROR! > > John > > <?php > $errorfound = 0; > $yourimage = > > "http://callisto.si.usherb.ca/~ang96m04/cgi-bin/postcards/e.jpegstrie/sap_bucket.jpg"; > > // if((!strpos($yourimage, ".jpg")) or (!strpos($yourimage, ".jpeg"))) > if((!strpos($yourimage, ".jpg")) and (!strpos($yourimage, ".jpeg"))) > { > $errorfound++; > echo"Your image \"<font > color=\"000000\">$yourimage</font>\"<br> did > not contain .jpg or .jpeg</b>"; > }else{ > echo"Your image \"<font > color=\"000000\">$yourimage</font>\" contains > .jpg or .jpeg</b>"; > } > > ?> > > > > -- > PHP General Mailing List (http://www.php.net/) > To unsubscribe, e-mail: php-general-unsubscribe@lists.php.net > For additional commands, e-mail: php-general-help@lists.php.net > To contact the list administrators, e-mail: php-list-admin@lists.php.net Joe Stump <joe@joestump.net> ------------------------------------------------------------------------ "How would this sentence be different if pi equaled 3?"

« previous php.general (#75043) next »