Re: file_exists
| From: | Chris | Date: | Wed, 14 Nov 2007 07:53:27 +0000 |
| Subject: | Re: file_exists | ||
| References: | 1 | Groups: | php.general |
| Request: | Send a blank email to php-general+get-264477@lists.php.net to get a copy of this message | ||
Ronald Wiplinger wrote:
I am having troubles with the function file_exists() I tried the full path like: if (file_exists('/srv/www/....../images/pic412.jpg') {That could be because you're not referencing the image properly in the <img src> Should that be <img src="/images/pic412.jpg"> ? How do you view the image in your browser? Take off the domain name and that's exactly what you need to show in the image source. ie if the right image source is: http://domain.com/images/image.jpg then your image source needs to be: /images/image.jpg The '/' at the start will make a big difference. -- Postgresql & php tutorials http://www.designmagick.com/echo "<IMG SRC='images/pic412.jpg'>";} else {echo " " // picture is missing!} No matter if I use the full path or just images/pic412.jpg, it always shows the picture is missing!