Code:<html> <head> <title>Example #1 TDavid's Very First PHP Script ever!</title> </head> <? print(Date("l F d, Y")); ?> <body> </body> </html>
Code:<html> <head> <title>Example #1 TDavid's Very First PHP Script ever!</title> </head> <? print(Date("l F d, Y")); ?> <body> </body> </html>
Code:<html> <head> <title>Example #3 TDavid's Very First PHP Script ever!</title> </head> <? print(Date("m/j/y")); ?> <body> </body> </html>
Code:<html> <head> <title>Background Colors change based on the day of the week</title> </head> <? $today = date("l"); print("$today"); if($today == "Sunday") { $bgcolor = "#FEF0C5"; } elseif($today == "Monday") { $bgcolor = "#FFFFFF"; } elseif($today == "Tuesday") { $bgcolor = "#FBFFC4"; } elseif($today == "Wednesday") { $bgcolor = "#FFE0DD"; } elseif($today == "Thursday") { $bgcolor = "#E6EDFF"; } elseif($today == "Friday") { $bgcolor = "#E9FFE6"; } else { // Since it is not any of the days above it must be Saturday $bgcolor = "#F0F4F1"; } print("<body bgcolor=\"$bgcolor\">\n"); ?> <br>This just changes the color of the screen based on the day of the week </body> </html>
Code:<html> <head> <title>Background Colors change based on the day of the week</title> </head> <? $today = date("w"); $bgcolor = array( "#FEF0C5", "#FFFFFF", "#FBFFC4", "#FFE0DD", "#E6EDFF", "#E9FFE6", "#F0F4F1" ); ?> <body bgcolor="<?print("$bgcolor[$today]");?>"> <br>This just changes the color of the screen based on the day of the week </body> </html>
Last edited by sherlyk; 04-30-2014 at 08:43 AM.
Code:<html> <head> <title>Page last updated on month/date/year hour:min PHP Script</title> </head> <? $last_modified = filemtime; print("Last Modified "); print(date("m/j/y h:i", $last_modified)); ?> </body> </html>
Last edited by sherlyk; 04-30-2014 at 08:44 AM.
Bookmarks