Jump to content


Problem with PHP execution or maybe relative path

  • Please log in to reply
No replies to this topic

#1 hadoob024

  • Members
  • PipPipPip
  • Advanced Member
  • 192 posts

Posted 10 March 2006 - 09:31 PM

Recently to help with security, I had my web hosting company create a directory for me that's outside of the web document tree. There's a directory called 'Includes' that's located on the same level as the directory 'html'.

Anyway, in the 'Includes' directory, there is a sub-directory called 'Ads'. In this directory, there is a PHP file called 'banner_ads.php' and a bunch of JPG image files. In this php file, I run a simple command:
echo '<img src="/home/virtual/ofre.com/var/www/includes/Ads/ad1.jpg" border=0 />';

Anyways, when I call this file 'banner_ads.php' from a script that's in the web document tree like so:
include_once ('/home/virtual/ofre.com/var/www/includes/Ads/banner_ads.php');

This image does not get displayed. Is there an issue with the way PHP files are run when outside the web document tree? Am I having the command point to the wrong location/path? Thanks!

0 user(s) are reading this topic

0 members, 0 guests, 0 anonymous users