Jump to content

file_exists problem


The Little Guy

Recommended Posts

This may be more complicated than the following code, maybe not.

First off, here is the basic code:

if(file_exists('cat'))
     echo 'yes';
else
     echo 'no';

 

the above file (index.php) is in the exact same directory as "cat". dir layout:

root
  |
  +-cat
  |
  +-index.php

 

OK, with that being said, The file "index.php" is being run through another file "viewFile.php", using some .htaccess rules, if you go to http://test.hostbox.us/index.php you are actually are going to http://hostbox.us/subdomains/test/index.php where test is the root.

 

the above file will work if you go to http://hostbox.us/subdomains/test/index.php it will say yes

but if you go here: http://test.hostbox.us/index.php it will say no

 

What I need is for both urls to say yes

if(file_exists($readF)){
if(!$err && !$isO){
	include($readF);  // This includes the file that will be read in such as index.php
}else{
	readfile($readF);
}
}

Link to comment
https://forums.phpfreaks.com/topic/112610-file_exists-problem/
Share on other sites

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.