Welcome to WebmasterWorld Guest from 54.146.246.4

Forum Moderators: coopster & jatar k

Message Too Old, No Replies

Image include script

Hung up on home page syntax

     

King of Bling

3:48 pm on Jul 6, 2007 (gmt 0)

10+ Year Member



I am using a simple script to call images based on location...

<?if(strpos($_SERVER['PHP_SELF'],"/accommodations/")!==false){?>

but having a hard time when it comes to the index/root/home page as it confuses with all other directories index page.

<?if(strpos($_SERVER['PHP_SELF'],"/index.php")!==false){?>

Is there an easy solution for the home page?

TIA KOB

JAB Creations

3:56 pm on Jul 6, 2007 (gmt 0)

WebmasterWorld Senior Member jab_creations is a WebmasterWorld Top Contributor of All Time 10+ Year Member



I'm not exactly sure if this is helpful but a friend showed me a better way to access relative paths in PHP. This is how I use it for relative includes...

include realpath(dirname(__FILE__) . "/../../index.php");

- John