Reply to Re: Another dumb newbie question regarding Date and Time

Your name:

Reply:


Posted by Jim Carlock on 01/30/06 10:27

"Denebola" <simon@minnican.co.uk> wrote:
> Carl...would it be possible for you to explain each line of
> the script you have written for me please. It will help me
> understand php. Also I need a link from the images to a
> webpage..... how do I achieve that.

The switch statement is pretty much the same throughout many
programming languages.

http://www.w3schools.com/js/js_switch.asp
http://www.w3schools.com/php/php_conditionals.asp
http://us3.php.net/manual/en/control-structures.switch.php

For:

print 'Image 1';

Carl probably should have put the html code there to display
a sample image. For example:

print '<img src="../images/imagename.jpg" border="0" height="100" width="100" />';

You could employ the echo statement as well instead of print.

echo '<img src="../images/imagename.jpg" border="0" height="100" width="100" />';

They both output your html code and such to the client's
browser.

http://www.w3schools.com/php
http://www.w3schools.com/php/php_ref_string.asp
http://www.w3schools.com/php/func_string_echo.asp

http://us3.php.net/manual/en/function.print.php

The echo statement doesn't return a value and so is slightly
faster, whereas print() always returns "1".

Hope that helps.

Jim Carlock
Post replies to the newsgroup.

Carl Vondrick wrote:
// Switch statement based off server time
switch (date('H i s D')) {
case '08 10 30 Mon':
print 'Image 1';
break;
case '08 45 10 Mon':
print 'Image 2';
break;
}

[Back to original message]


Удаленная работа для программистов  •  Как заработать на Google AdSense  •  England, UK  •  статьи на английском  •  PHP MySQL CMS Apache Oscommerce  •  Online Business Knowledge Base  •  DVD MP3 AVI MP4 players codecs conversion help
Home  •  Search  •  Site Map  •  Set as Homepage  •  Add to Favourites

Copyright © 2005-2006 Powered by Custom PHP Programming

Сайт изготовлен в Студии Валентина Петручека
изготовление и поддержка веб-сайтов, разработка программного обеспечения, поисковая оптимизация