viperfx07 is here to blog about hacking, cracking, website, application, android, and many more.

Tuesday, August 24, 2010

Week 4 Practical Exercise

1:35 PM Posted by viperfx07 No comments
Week 4 materials are about server-side technologies, which focus on PHP.

For the exercise, we're gonna use date function on PHP. If you want to see the documentation without going online, just download the documentation here

Don't hesitate to click Read More.

Date function
string date ( string $format [, int $timestamp ] )

Returns a string formatted according to the given format string using the given integer timestamp or the current time if no timestamp is given. In other words, timestamp is optional and defaults to the value of time().

Original file week4prac.php
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN"
 "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">

<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
<head>
 <meta http-equiv="Content-Type" content="text/html; charset=utf-8"/>

 <title>Week 4 Practical</title>
 
</head>

<body>
<?php
echo "The date is: ";
echo date("d m Y H:i:s");

?>

</body>
</html>


The output for the code above: The date is: 24 08 2010 13:29:35

To get 'Monday 15th of August 2005 03:12:46 PM' as the output <-- (not the exact date) Change line 15 to
echo date("l jS \of F Y h:i:s A");

For the question of what sort of online database administration system is provided by my webhost (which is 000webhost.com), it is PhpMyAdmin.

0 comments:

Post a Comment