RE: [PHP] If else question
| From: | NCI/IMS) | Date: | Tue, 23 Apr 2002 16:47:33 +0000 |
| Subject: | RE: [PHP] If else question | ||
| Groups: | php.general | ||
| Request: | Send a blank email to php-general+get-94200@lists.php.net to get a copy of this message | ||
My officemate and I talked about this and the only thing he could come up
with was a possible problem with your parser. Are you using a beta version
or something unusual? I don't know if you have a way to know this - the
programmers didn't set up PHP where I work, but I know our web server is
apache and it's on a unix box. I've never run into this problem before.
Have you had it happen in other programs? Have you ever used this code in
another program? If it's consistently incorrect then it may be a problem
with your parser. That's not really my area of expertise, but it's
something you could look into if no one else has any better ideas :-)
-Natalie
-----Original Message-----
From: Jennifer Downey [mailto:jendowney@attbi.com]
Sent: Tuesday, April 23, 2002 12:26 PM
To: php-general@lists.php.net
Subject: Re: [PHP] If else question
It shows both.
"Natalie Leotta" <LeottaN@ims.nci.nih.gov> wrote in message
news:7546CB15C0A1D311BF0D0004AC4C4B0C024ABFC3@SSIMSEXCHNG...
> Does it show the message and the form or just the message?
>
> -Natalie
>
> -----Original Message-----
> From: Jennifer Downey [mailto:jendowney@attbi.com]
> Sent: Tuesday, April 23, 2002 12:23 PM
> To: php-general@lists.php.net
> Subject: Re: [PHP] If else question
>
>
>
> > If and else expect to be followed by exactly 1 statement. To
> > aggregate multiple statements as one, surround them with {curly
> > braces}. I'm guessing you didn't do that, and you're seeing the
> > execution of all but the first of the statements following the else.
> >
> > So it should be:
> >
> > if ($var<1)
> > echo "can't be found";
> > else
> > {
> > echo "first line of form";
> > echo "second line of form";
> > }
> This is what I have:
>
> if($quantity < 1)
> {
> echo "Sorry I can't seem to locate this item";
> }
> else
> {
> do this
> }
> So yes I have done exactly as you have stated and it still shows the
> form.
>
> Jennifer
>
>
> ---
> Outgoing mail is certified Virus Free.
> Checked by AVG anti-virus system (http://www.grisoft.com).
> Version: 6.0.351 / Virus Database: 197 - Release Date: 4/19/2002
>
>
>
> --
> PHP General Mailing List (http://www.php.net/)
> To unsubscribe, visit: http://www.php.net/unsub.php
---
Outgoing mail is certified Virus Free.
Checked by AVG anti-virus system (http://www.grisoft.com).
Version: 6.0.351 / Virus Database: 197 - Release Date: 4/19/2002
--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php