Re: If statements and images

From: Date: Wed, 15 Nov 2000 19:24:37 +0000
Subject: Re: If statements and images
References: 1  Groups: php.general 
Request: Send a blank email to php-general+get-25505@lists.php.net to get a copy of this message
Hi Mike, Then echo the HTML <IMG> tag. > if($day == "Mon") > { > echo 'images/monday.png'; > change your echo to: echo '<img src="images/monday.png">'; Hopefully this helps. -jeremy http://www.JeremyBrand.com/Jeremy/Brand/Jeremy_Brand.html for more --------------------------------------------------------------------- We cannot do everything at once, but we can do something at once. -- Calvin Coolidge On Wed, 15 Nov 2000, Mike Tuller wrote: > Date: Wed, 15 Nov 2000 13:19:24 -0600 > From: Mike Tuller <mitull01@willy.wsc.edu> > To: php-general@lists.php.net > Subject: Re: [PHP] If statements and images > > Ok, I don't think I was clear on my intensions. I want the variable in an if > statement to be set as an image rather than text. If I use echo or print, I > get text back. I want to have the image display. > > Here is what I have so far: > > <?PHP > > $day = date("D"); > > if($day == "Mon") > { > echo 'images/monday.png'; > > } elseif ($day == 'Tue') > { > echo 'images/tuesday.png'; > > } elseif ($day == 'Wed') > { > echo 'images/wednesday.png'; > > } elseif ($day == 'Thu') > { > print 'images/thursday.png'; > > } elseif ($day == 'Fri') > { > echo 'images/friday.png'; > > } elseif ($day == 'Sat') > { > echo 'images/saturday.png'; > > } elseif ($day == 'Sun') > { > echo 'images/sunday.png'; > } > > ?> > > > From: Maxim Maletsky <maxim.maletsky@japaninc.net> > > Date: Wed, 15 Nov 2000 14:54:36 +0900 > > To: > > "'Lawrence.Sheed@dfait-maeci.gc.ca'"<Lawrence.Sheed@dfait-maeci.gc.ca>, > > mitull01@willy.wsc.edu, php-general@lists.php.net > > Subject: RE: [PHP] If statements and images > > > > ooppsss.. big ignorance from my side ... > > > > OK, I won't turn itt into a new crazy thread ... (even if I am curiouse, > > guess i should read the manual more often ..) > > > > Thanks > > > > -----Original Message----- > > From: Lawrence.Sheed@dfait-maeci.gc.ca > > [mailto:Lawrence.Sheed@dfait-maeci.gc.ca] > > Sent: Wednesday, November 15, 2000 2:50 PM > > To: Maxim Maletsky; mitull01@willy.wsc.edu; php-general@lists.php.net > > Subject: RE: [PHP] If statements and images > > > > > > print gets flushed on a flush(); > > > > echo does not (according to the php manual). > > > > In addition print() function returns a boolean indicating the status of the > > call. If the write was successful, print() returns 1. If not, it returns 0. > > This can be used to detect when the client has closed the connection, and > > appropriate measures can be taken. > > > > > > Lets not turn this into require vs include vs print vs echo? :) > > > > -----Original Message----- > > From: Maxim Maletsky [mailto:maxim.maletsky@japaninc.net] > > Sent: November 15, 2000 01:42 PM > > To: 'Mike Tuller'; php > > Subject: RE: [PHP] If statements and images > > > > > > I have no idea what you asked but echo and print are not diferent at all. > > > > guessing your question I would do this: > > > > $day = 'Mon'; > > echo $day.'day.png'; > > > > if you do it so then you MUST have a good system to call all of your > > graphics and know that the variables are called equally to fit into the > > graphic file names. > > > > Cheers, > > Maxim Maletsky > > > > -----Original Message----- > > From: Mike Tuller [mailto:mitull01@willy.wsc.edu] > > Sent: Wednesday, November 15, 2000 2:33 PM > > To: php > > Subject: [PHP] If statements and images > > > > > > I've been wanting to display the day of the week as an image within Flash, > > and the only examples I can find of if statements deal with strings. How can > > I set the variable to display an image? > > > > Example: > > > > if(date("D") == "Mon") > > { > > echo ("Monday"); > > > > I want it to display Monday.png rather than "Monday". Do I still use echo or > > print? > > > > Mike > > > > > > > > -- > > PHP General Mailing List (http://www.php.net/) > > To unsubscribe, e-mail: php-general-unsubscribe@lists.php.net > > For additional commands, e-mail: php-general-help@lists.php.net > > To contact the list administrators, e-mail: php-list-admin@lists.php.net > > > > -- > > PHP General Mailing List (http://www.php.net/) > > To unsubscribe, e-mail: php-general-unsubscribe@lists.php.net > > For additional commands, e-mail: php-general-help@lists.php.net > > To contact the list administrators, e-mail: php-list-admin@lists.php.net > > > > -- > > PHP General Mailing List (http://www.php.net/) > > To unsubscribe, e-mail: php-general-unsubscribe@lists.php.net > > For additional commands, e-mail: php-general-help@lists.php.net > > To contact the list administrators, e-mail: php-list-admin@lists.php.net > > > -- > PHP General Mailing List (http://www.php.net/) > To unsubscribe, e-mail: php-general-unsubscribe@lists.php.net > For additional commands, e-mail: php-general-help@lists.php.net > To contact the list administrators, e-mail: php-list-admin@lists.php.net > >

« previous php.general (#25505) next »