if(file_exists("./squadra/photos/photog.jpg")) { echo "### YES ###"; } else { echo "### NO ###"; }
if I run this function on /zones/team.php, it works (it prints YES). If I run this function on /auth/ajax.php, type NO. Why?
EDIT
So, I am doing an experiment.
1 - If I try:
// file on /zones/team.php if(file_exists($_SERVER['DOCUMENT_ROOT']."/squadra/photos/provag.jpg")) { echo "YES"; } else { echo "NO"; } // file on /auth/ajax.php if(file_exists($_SERVER['DOCUMENT_ROOT']."/squadra/photos/provag.jpg")) { echo "YES"; } else { echo "NO"; }
he says “NO” to both;
2 - If I try:
// file on /zones/team.php if(file_exists("./squadra/photos/provag.jpg")) { echo "YES"; } else { echo "NO"; } // file on /auth/ajax.php if(file_exists("../squadra/photos/provag.jpg")) { echo "YES"; } else { echo "NO"; }
he says YES to both; But on team.php im using./ and on ajax.php .. / ... why does this work ???
source share