View Single Post
  #79 (permalink)  
Old 07-21-2008, 12:38 PM
chili5's Avatar   
chili5 chili5 is online now
Code Warrior
 
Join Date: Mar 2008
Age: 16
Posts: 3,935
Last Blog:
DWITE 2
Credits: 0
Rep Power: 35
chili5 is a name known to allchili5 is a name known to allchili5 is a name known to allchili5 is a name known to allchili5 is a name known to allchili5 is a name known to all
Default Re: Including header file using HTML

Well i think you need to use eregi inside a if statement or as some kind of decision to do anything with it. If I just echo the results of eregi, it will either return 1 for true or 0 for false. Which I can't do anything with.

PHP Code:
<?php
if (eregi("header.php",$_SERVER['PHP_SELF'])) {
header("Location: index.php");
}
?>
However, if i check it for true, i can redirect the user away from the included file or have custom content for a certain page.

header.php:
PHP Code:
<?php
if (eregi("index.php",$_SERVER['PHP_SELF'])) {
echo 
"<img src=\"logo.jpg\" alt=\"logo\" />";
} else {
echo 
"<a href=\"index.php\"><img src=\"logo.jpg\" alt=\"logo\" border=\"0\" /></a>";
}
?>
see, if your on the home page, it doesn't make sense to link the logo to the home page, so you can use eregi to test what page, your on and link the logo if your not on the home page.
__________________
I've found time can heal most anything
And you just might find who you're supposed to be
I didn't know who I was supposed to be at fifteen.
~ Taylor Swift
Reply With Quote