If else URL problems in sidebar.php
-
Hello, Im having a problem. I want a table with a picture to show in the sidebar on all pages except one. (http://www.mysite.com/blogg), so i set up a if else statement like this;
<?php
$url = $_SERVER[‘HTTP_HOST’].$_SERVER[‘REQUEST_URI’];
if ($url == “http://www.MYSITE.no/blogg/”) {
echo “<div></div>”;
} else {
echo “<table width=’317′ cellspacing=’0′ cellpadding=’0′ align=’left’>
<tr>
<td width=’317′ align=’left’ valign=’top’ style=’padding-bottom:8px;’>
<img src=’../../../graphic/nyhet.jpg’>
</td>
</tr>
</table>”;
};
?>But that doesnt work. What have i done wrong? Are there a hack I must do since the sidebar.php are included in all the pages, and maybe cant read any url’s? Do anyone know? I use permalinks to my pages as you can see at the top. Thanks for any answer!
The topic ‘If else URL problems in sidebar.php’ is closed to new replies.