jazzylee77
Nov 8th 2007, 7:48 pm
I'm wanting to show a different submenu file for different folders of a dynamic script. This is what I have so far, but doesn't work.
<?php
function curPageURL() {
$pageURL = 'http';
if ($_SERVER["HTTPS"] == "on") {$pageURL .= "s";}
$pageURL .= "://";
if ($_SERVER["SERVER_PORT"] != "80") {
$pageURL .= $_SERVER["SERVER_NAME"].":".$_SERVER["SERVER_PORT"].$_SERVER["REQUEST_URI"];
} else {
$pageURL .= $_SERVER["SERVER_NAME"].$_SERVER["REQUEST_URI"];
}
return $pageURL;
}
?>
<?php
echo curPageURL();
?>
<?php
if (curPageURL() = “http://www.mysite.com/tag/Sports") {
include("Sports.php");
} else {
include("default.php");
}
?>
I had the echo curPageURL(); part in there just to test that it was getting pageurl ok and it worked till I added the bit afterward.
<?php
function curPageURL() {
$pageURL = 'http';
if ($_SERVER["HTTPS"] == "on") {$pageURL .= "s";}
$pageURL .= "://";
if ($_SERVER["SERVER_PORT"] != "80") {
$pageURL .= $_SERVER["SERVER_NAME"].":".$_SERVER["SERVER_PORT"].$_SERVER["REQUEST_URI"];
} else {
$pageURL .= $_SERVER["SERVER_NAME"].$_SERVER["REQUEST_URI"];
}
return $pageURL;
}
?>
<?php
echo curPageURL();
?>
<?php
if (curPageURL() = “http://www.mysite.com/tag/Sports") {
include("Sports.php");
} else {
include("default.php");
}
?>
I had the echo curPageURL(); part in there just to test that it was getting pageurl ok and it worked till I added the bit afterward.