Skip to content

Instantly share code, notes, and snippets.

@safranck
Last active August 29, 2015 14:15
Show Gist options
  • Save safranck/4f377e19dc16e2ea4c26 to your computer and use it in GitHub Desktop.
Save safranck/4f377e19dc16e2ea4c26 to your computer and use it in GitHub Desktop.
Introduction to PHP and MySQL Starting file
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<?php
//create a function called myDate that outputs today's date
function myDate() {
//Define the variables
$year = date('Y'); // get current year
$month = date('M'); // get month
$date = date('j'); // get day of the month
$day = date('l'); // get day of the week
$today = $day . ', ' . $month . ' ' . $date . ', ' . $year;
//Show us the results when called
echo $today;
}
?>
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
<head>
<title>Welcome!</title>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8"/>
<link rel="shortcut icon" href="/favicon.ico" />
<link rel="stylesheet" type="text/css" href="style.css">
<meta name="robots" content="noindex" />
</head>
<body>
<div id="page">
<div id="header" class="header">
<h1>Welcome to Miss Suzette&#39;s Class</h1>
</div>
<div id="content">
<h3>Today is <?php myDate(); ?>.</h3>
<h1>Let's Develop It!</h1>
<?php //We'll practice some PHP below ?>
</div>
<div id="footer">
<p>Powered by <a href="http://girldevelopit.com">Girl Develop It</a></p>
</div>
</div>
</body>
</html>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment