Re: file_exists
| From: | Austin Marshall | Date: | Tue, 07 May 2002 01:28:23 +0000 |
| Subject: | Re: file_exists | ||
| References: | 1 | Groups: | php.general |
| Request: | Send a blank email to php-general+get-96343@lists.php.net to get a copy of this message | ||
Craig Westerman wrote:
What am I doing wrong? I get parse error between first echo statement and else. Thanks Craig ><> westerman@chanuteks.com <?php $fn = "image.gif"; if (!file_exists($fn)) { echo "<img src=noimageexists.gif>"; else echo "<img src=$fn>"; } ?>You've got your semicolons in the wrong spots. Try: <?php $fn = "image.gif"; if (!file_exists($fn)) { echo "<img src=noimageexists.gif>"; } else { echo "<img src=$fn>"; } ?>