Hi there. I hope it's okay that I'm asking a question similar to this unresolved question.
I have an image that I can reach on my local machine like so:
http://localhost/project/images/tiger.png
And then this code:
<?php
$filepath = "images/tiger.png";
if (!file_exists($filepath)) {
echo "File does not exist <br>";
}
else {
echo mime_content_type($filepath) . "<br>";
}
?>
Bizarrely, it passes the file_exists test, but then mime_content_type spits out
Warning: mime_content_type() [function.mime-content-type]: File or path not found 'images/tiger.png' in C:\xampplite\htdocs\project\test2.php on line 12
If the file can't be found, how on earth is it passing the file_exists?
I also tried with
$filepath = "http://localhost/project/images/tiger.png";
and in desperation I even tried
$filepath = "C:\xampplite\htdocs\project\images\tiger.png";
but those just give me "File does not exist."
If anyone can tell me what is going on here, I will be a very grateful newbie.