Create variables with IF staements

From: Date: Wed, 13 Dec 2000 00:17:28 +0000
Subject: Create variables with IF staements
Groups: php.general 
Request: Send a blank email to php-general+get-29988@lists.php.net to get a copy of this message
I am trying to assign a variable from the result of an IF statement. How an I do this in php? I have a field called FileImageURL which houses nopic.jpg if no picture is there and if there is a picture it returns apicture.jpg. I want it to display an image called jpg.gif if there is a picture and blank.gif if there isn't. I want to insert the result as a variable in my tables as $Image. Any suggestions? David Smith /////// $Image = result of below... /////// if($FileImageURL=="nopic.jpg") { echo "<IMG SRC=\"/home/warbirds/images/blank.gif\" BORDER=\"0\">"; } else { echo "<IMG SRC=\"/home/warbirds/images/jpg.gif\" BORDER=\"0\">"; } endif

« previous php.general (#29988) next »