lonebyrd 0 Report post Posted April 26, 2006 I am trying to get a date and time to show up on my webpage, but for some reason, all I get is the name just above it. Here is the code, I know I must be a complete bafoon: <html><head><TITLE> Fantasized TeleVision</TITLE></head><body background="http://i6.photobucket.com/albums/y215/lonebyrd/TVF/Background.jpg"><center><h1><font color=red><u>Fantasized TeleVision</u></font></h1> </center><align="right">New Rork City</align><?php $today = date("F j, Y, g:i a"); ?></body></html> I know the code must be wrong somewhere, but I just cant figure it out. Can someone please help me out? Share this post Link to post Share on other sites
miCRoSCoPiC^eaRthLinG 0 Report post Posted April 26, 2006 ............ ... <align="right">New Rork City</align> <?php $today = date("F j, Y, g:i a"); ?> ... ... Notice the part of code I've hightlighted here.. See when you execute this statement - $today = date("F j, Y, g:i a");, PHP simply extracts the current date/time and stores it in a variable called $today and does nothing else. You need to include a statement like echo that will actually PRINT this out on the webpage. So your code should look like: <?php $today = date("F j, Y, g:i a"); echo $today;?> That should do the trick Any more questions feel free to drop a line.. Regards, m^e Share this post Link to post Share on other sites
Saint_Michael 3 Report post Posted April 26, 2006 pretty much what M^E said but to help you a bit more and to clean it up a bit use this <?PHPecho date("D M d, Y H:i:s");?>also if you want you date and time to look more dynamic check this site out http://phptutorial.info/learn/datetime.php Share this post Link to post Share on other sites