note 27949 added to control-structures.else
| From: | spork at keenintelect dot com | Date: | Fri, 27 Dec 2002 06:28:13 +0000 |
| Subject: | note 27949 added to control-structures.else | ||
| Groups: | php.notes | ||
| Request: | Send a blank email to php-notes+get-41334@lists.php.net to get a copy of this message | ||
Here is a sample code that checks for a user image. If its not there it displays the defined
"not found" image.
<?
if (file_exists("./user_images/" . $_GET['user_small'] . ".jpg"))
{ ?>
<a href='./index.php?p=user_image&id=<? echo $user_small ?>.jpg'><img
src='./user_images/<? echo $user_small ?>_small.jpg'
border='2'></a>
<?
} else {
?>
<img src="./user_images/notfound.jpg" border="2">
<?
}
?>
Code in action here.
http://www.keenintelect.com/~bebop/index.php?p=users
--
http://www.php.net/manual/en/control-structures.else.php
http://master.php.net/manage/user-notes.php?action=edit+27949
http://master.php.net/manage/user-notes.php?action=delete+27949
http://master.php.net/manage/user-notes.php?action=reject+27949