php-general | 2001072
Date: 07/25/01
- Next message: Christian Reiniger: "Re: [PHP] Turning a filehandle into an array"
- Previous message: J S R: "[PHP] "OR" Problems"
- In reply to: J S R: "[PHP] "OR" Problems"
- Next in thread: David Robley: "Re: [PHP] "OR" Problems"
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]
Why aren't you using the brackets?
if (statement){
....
} else {
....
}
SED
-----Original Message-----
From: J S R [mailto:shkwave <email protected>]
Sent: 25. júlí 2001 04:06
To: php-general <email protected>
Subject: [PHP] "OR" Problems
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.
<?php
$name = getenv ("SCRIPT_NAME");
?>
<?php
if($name == "/site/portfolio.php" or "/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
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>"
?>
-- PHP General Mailing List (http://www.php.net/) To unsubscribe, e-mail: php-general-unsubscribe <email protected> For additional commands, e-mail: php-general-help <email protected> To contact the list administrators, e-mail: php-list-admin <email protected>-- PHP General Mailing List (http://www.php.net/) To unsubscribe, e-mail: php-general-unsubscribe <email protected> For additional commands, e-mail: php-general-help <email protected> To contact the list administrators, e-mail: php-list-admin <email protected>
- Next message: Christian Reiniger: "Re: [PHP] Turning a filehandle into an array"
- Previous message: J S R: "[PHP] "OR" Problems"
- In reply to: J S R: "[PHP] "OR" Problems"
- Next in thread: David Robley: "Re: [PHP] "OR" Problems"
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]

