Re: "OR" Problems
| From: | J S R | Date: | Thu, 26 Jul 2001 14:32:00 +0000 |
| Subject: | Re: "OR" Problems | ||
| References: | 1 2 | Groups: | php.general |
| Request: | Send a blank email to php-general+get-59750@lists.php.net to get a copy of this message | ||
Thank you soooo much david.
"David Robley" <huntsman@www.nisu.flinders.edu.au> wrote in message
news:01072515394001.32266@www...
> On Wed, 25 Jul 2001 13:36, J S R wrote:
> > Shouldn't this work? I did it because I want the link to change to the
> > "top-alt" class when the certain link is selected.
> >
> > but when i do this... they "if" statement is always active even if its
> > not on the page.
> >
> > what am i doing wrong.
>
> Several things, by the looks of it :-:
>
> >
> > <?php
> > $name = getenv ("SCRIPT_NAME");
> > ?>
> >
> > <?php
> > if($name == "/site/portfolio.php" or "/site/portfolio-ps.php)
>
> if($name == "/site/portfolio.php" or $name == "/site/portfolio-ps.php)
> {
>
> > echo "<td nowrap><img src=\"images/spacer.gif\"
> > width=\"110\"
> > height=\"1\"><a class=\"top-alt\"
> > href=\"portfolio.php\">portfolio</a></td>";
> > else
>
> } else {
>
> > echo "<td nowrap><img src=\"images/spacer.gif\"
> > width=\"110\"
> > height=\"1\"><a class=\"top\"
> > href=\"portfolio.php\">portfolio</a></td>" ?>
> > <?php
> > if($name == "/site/services.php" or "/site/services-ws.php")
> > echo "<td nowrap><img src=\"images/spacer.gif\"
> > width=\"20\"
> > height=\"1\"><a class=\"top-alt\"
> > href=\"services.php\">services</a></td>"; else
> > echo "<td nowrap><img src=\"images/spacer.gif\"
> > width=\"20\"
> > height=\"1\"><a class=\"top\"
> > href=\"services.php\">services</a></td>"
> > ?>
> > <?php
> > if($name == "/site/casestudies.php" or "/site/casestudies-ap.php")
> > echo "<td nowrap><img src=\"images/spacer.gif\"
> > width=\"20\"
> > height=\"1\"><a class=\"top-alt\"
> > href=\"casestudies.php\">case
> > studies</a></td>";
> > else
> > echo "<td nowrap><img src=\"images/spacer.gif\"
> > width=\"20\"
> > height=\"1\"><a class=\"top\"
> > href=\"casestudies.php\">case
> > studies</a></td>"
> > ?>
>
> and there are a few more of thtose down the page. I'll leave you to sort
> them out :-)
>
> --
> David Robley Techno-JoaT, Web Maintainer, Mail List Admin, etc
> CENTRE FOR INJURY STUDIES Flinders University, SOUTH AUSTRALIA
>
> "I'm embarrassed," Tom admitted readily.