homepage Welcome to WebmasterWorld Guest from 54.196.197.153
register, free tools, login, search, pro membership, help, library, announcements, recent posts, open posts,
Become a Pro Member
Home / Forums Index / Code, Content, and Presentation / PHP Server Side Scripting
Forum Library, Charter, Moderators: coopster & jatar k

PHP Server Side Scripting Forum

    
Image include script
Hung up on home page syntax
King of Bling




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

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




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

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

Global Options:
 top home search open messages active posts  
 

Home / Forums Index / Code, Content, and Presentation / PHP Server Side Scripting
rss feed

All trademarks and copyrights held by respective owners. Member comments are owned by the poster.
Home ¦ Free Tools ¦ Terms of Service ¦ Privacy Policy ¦ Report Problem ¦ About ¦ Library ¦ Newsletter
WebmasterWorld is a Developer Shed Community owned by Jim Boykin.
© Webmaster World 1996-2014 all rights reserved