使用File_Exists将页面置空

I'm checking to see if a file or directory exists using -

 <?php  
 $filename = "../ads/";
 if(file_exists($filename)) ?>

It works but when I'm NOT in the root. If I'm in another directory .... For Example - If I'm in the "ads" directory and I view the-ads.php the page goes blank because in the header I have the file_exists code.

IF I remove .. from ../ads/ the page displays like it should.

What should I do? I need .. in the path ../ads/.

I fixed this by creating a config and mapping the

../ads/ AS ../../ads/

In the config in ads dir I added

define('THEURL','../../ads/');

In the header code added THEURL in replace of ../ads/