Hi,
I am working on a PHP script that automatically displays an image based on certain elements (which don't matter for the sake of the question since that part works perfectly fine.) Out of the browsers I have tested it in, the images are correctly displayed on Google Chrome, Internet Explorer, and Safari. However, they do not appear on Firefox or Opera. In Firefox, nothing is displayed and in Opera the path of the image is http://server/folder/%5Cimages%5C40.jpg which should be http://server/folder/images/40.jpg. The code used to generate the URL is as follows:
echo "<div class='jumih3'>" . $row['fname'] . " " . $row['lname'] . "</div>";
$image = JURI::root() . "\/images\/" . $row['id'] . ".jpg";
$imagetest = JPATH_ROOT . "\/images\/" . $row['id'] . ".jpg";
if (file_exists($imagetest))
{
echo "<br /><img src='" . $image . "'width='100' height='100' /><br />";
}
This is part of a Joomla site and the JURI:root() and JPATH_ROOT provide absolute locations of the server. The way that Opera parses the URL I'm suspecting something is wrong with the way I am escaping the slashes. However, when I tried using / instead of \/ the images did not appear in any browser.
EDIT: As you can see from Zannjaminderson's answer, the problem's fixed in a facepalm kind of way.