Date: 11/15/00
- Next message: Rebecca: "Re: [PHP] Interesting"
- Previous message: Stephan Engelke: "Re: [PHP] Interesting"
- In reply to: Mike Tuller: "Re: [PHP] If statements and images"
- Next in thread: Mike Tuller: "Re: [PHP] If statements and images"
- Reply: Mike Tuller: "Re: [PHP] If statements and images"
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]
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 <email protected>>
> To: php-general <email protected>
> 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 <email protected>>
> > Date: Wed, 15 Nov 2000 14:54:36 +0900
> > To: "'Lawrence.Sheed <email protected>'"<Lawrence.Sheed <email protected>>,
> > mitull01 <email protected>, php-general <email protected>
> > 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 <email protected>
> > [mailto:Lawrence.Sheed <email protected>]
> > Sent: Wednesday, November 15, 2000 2:50 PM
> > To: Maxim Maletsky; mitull01 <email protected>; php-general <email protected>
> > 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 <email protected>]
> > 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 <email protected>]
> > 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 <email protected>
> > For additional commands, e-mail: php-general-help <email protected>
> > To contact the list administrators, e-mail: php-list-admin <email protected>
> >
> > --
> > PHP General Mailing List (http://www.php.net/)
> > To unsubscribe, e-mail: php-general-unsubscribe <email protected>
> > For additional commands, e-mail: php-general-help <email protected>
> > To contact the list administrators, e-mail: php-list-admin <email protected>
> >
> > --
> > PHP General Mailing List (http://www.php.net/)
> > To unsubscribe, e-mail: php-general-unsubscribe <email protected>
> > For additional commands, e-mail: php-general-help <email protected>
> > To contact the list administrators, e-mail: php-list-admin <email protected>
>
>
> --
> PHP General Mailing List (http://www.php.net/)
> To unsubscribe, e-mail: php-general-unsubscribe <email protected>
> For additional commands, e-mail: php-general-help <email protected>
> To contact the list administrators, e-mail: php-list-admin <email protected>
>
>
-- PHP General Mailing List (http://www.php.net/) To unsubscribe, e-mail: php-general-unsubscribe <email protected> For additional commands, e-mail: php-general-help <email protected> To contact the list administrators, e-mail: php-list-admin <email protected>
- Next message: Rebecca: "Re: [PHP] Interesting"
- Previous message: Stephan Engelke: "Re: [PHP] Interesting"
- In reply to: Mike Tuller: "Re: [PHP] If statements and images"
- Next in thread: Mike Tuller: "Re: [PHP] If statements and images"
- Reply: Mike Tuller: "Re: [PHP] If statements and images"
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]

