Forum Moderators: coopster
$file_name = 'products/'.$pId.'s.jpg';
if (file_exists($file_name))
$test = true;
else
$file_name = 'template/noimage.gif';
I tried changing the following line but it does not locate the image:
$file_name = '../products/'.$pId.'s.jpg';
The folder 'products' and 'template' are in the root directory.
ie. root/products
Could anyone help me with this problem?
Thanks in advance.
$file_name = '/products/'.$pId.'s.jpg';
$file_name = "{$_SERVER['DOCUMENT_ROOT']}/products/{$pId}s.jpg"; ;)
However a weird problem remains. It is recognising which files exists, and which files do not exist. (correct)
So the files that do not exist, it displays noimage.gif. (correct)
However, the files it did recognise that existed, are being displayed as broken links.