Re: Why won't this work?
| From: | Mantas Kriauciunas | Date: | Fri, 19 Jul 2002 09:31:15 +0000 |
| Subject: | Re: Why won't this work? | ||
| References: | 1 | Groups: | php.general |
| Request: | Send a blank email to php-general+get-108451@lists.php.net to get a copy of this message | ||
Hello John,
Friday, July 19, 2002, 12:25:12 AM, you wrote:
JW> Any ideas on why this won't work? It will only include("inc/entrance.php")
JW> It never, no matter what the value of $mode, displays collection.php.
thinking logicaly:
JW> <?php
JW> $mode = "entrance"; $mode is "entrance"
JW> if ($mode = "entrance") { looks if mode is "entrance"
JW> which is
JW> include("inc/entrance.php"); if was true so it includes entrance
JW> }
JW> else if ($mode = "collection") { looking again if for same $mode if it
JW> is "collection" but it was in first line "entrance"
JW> include("inc/collection.php"); if was false it never executes this
JW> part!
JW> }
JW> ?>
so what are you trying to get? both included?
if yes this will include both:
<?php
$mode = "entrance";
if ($mode = "entrance") {
include("inc/entrance.php");
}
$mode = "collection";
if ($mode = "collection") {
include("inc/collection.php");
}
?>
sorry if i didn't understood the question!
--
Best regards,
Mantas mailto:Mantuks@attbi.com