problems with file_exists() |
[eluser]Piatra[/eluser]
im having some trouble with the function file_exists(). it returns false even though the file exists eg. Code: if(file_exists($file)) echo "<img >"
[eluser]Mike DeFelice[/eluser]
I believe file_exists needs to use the relative path on the hard drive. For instance file_exists('./images/example.jpg');
[eluser]Mike DeFelice[/eluser]
I think I was confused, I thought you tried doing file_exists('http://www.example.com/test.jpg'); sorry about that!
[eluser]Piatra[/eluser]
[quote author="Mike DeFelice" date="1295756196"]I think I was confused, I thought you tried doing file_exists('http://www.example.com/test.jpg'); sorry about that![/quote] This is an example path Code: http://localhost/website/upload/1295355758768_thumb.jpg
[eluser]Mike DeFelice[/eluser]
file_exists() seems to only work for files on your server, not being able to use urls as the path. You can use some sort of curl function to do this, there are a lot of examples on the php site. http://php.net/manual/en/function.file-exists.php |
Welcome Guest, Not a member yet? Register Sign In |