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.