Monday, January 10, 2011

Monday 1/10/11

First PHP class today

http://localhost/

FIRST PHP TUTORIAL, from the book Programming PHP, 2nd Edition by Peter MacIntyre



<html>
<head>
<title>Personalized Hello World!</title>
</head>
<body>

<?php if(!empty($_POST['name'])) {
echo "Greetings, {$_POST['name']}, and welcome.";
} ?>

<form action="" method="post">
Enter your name: <input type="text" name="name" />
<input type="submit" />
</form>

</body>
</html>


Here is something short that I wrote myself involving both CSS and JavaScript.


<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN" "http://www.w3.org/TR/html4/strict.dtd">
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
<title>Untitled Document</title>
<LINK href="exampleCSS.css" rel="stylesheet" type="text/css">
<script style="text/javascript">
function changeColor()
{
document.getElementById('bigParagraph').className = "isBlue";
}
</script>
</head>
<body>
<p id="bigParagraph">Here is some data. Information information information</p>
</body>
<input type="button" value = "change color" onclick="changeColor()">
</html>

No comments: