I have the following code that to which the file is an
ajax call:
try {
echo
json_encode(exif_read_data($_POST["url"]));
} catch (Exception $e)
{
echo "Invalid
URL";
}
Its
purpose is to accept an image url and return the JSON-encoded EXIF data, and when there
is a "correct" url, the
json_encode(exif_read_data($_POST["url"]));
works just
fine.
However, when I intentionally
pass it a "bad" url in the jQuery ajax call
"url" : "url1"
, or in the php file directly
..exif_read_data("bob")
, I receive this error in my console
log:
Warning: exif_read_data()
[function.exif-read-data]: Unable to open file in ../public_html/_photos/ajax/exif.php
on line 3
false
No comments:
Post a Comment