Commit 6cdbfc4e authored by O'Reilly Media, Inc.'s avatar O'Reilly Media, Inc.
Browse files

Initial commit

parents
Loading
Loading
Loading
Loading
+32 −0
Changes for Learn to Build Web Applications with PHP, MySQL, and JavaScript - Working Files/Chapter 1/IF_statement.html: 32 added lines, 0 removed lines.
Original line number Diff line number Diff line
<!DOCTYPE HTML>

<html>
<head>
	<title>If Statement</title>
	<link rel="stylesheet" type="text/css" href="css/basic.css" />
</head>

<body>

<h3>The IF Statement</h3>

<form method="post" action="IF_statement.php">

	<p>
		First Name:<br>
		<input type="text" name="firstname" size="30">
	</p>

	<p>
		Birth Year:<br>
		<input type="text" name="birthyear" size="3">
	</p>

	<p>
	<input type="submit" value="Submit Information">
	</p>

</form>

</body>
</html>
+40 −0
Changes for Learn to Build Web Applications with PHP, MySQL, and JavaScript - Working Files/Chapter 1/IF_statement.php: 40 added lines, 0 removed lines.
Original line number Diff line number Diff line
<!DOCTYPE HTML>

<html>
<head>
	<title>If Statement</title>
	<link rel="stylesheet" type="text/css" href="css/basic.css">
</head>

<body>

<h3>The IF Statement</h3>

<?php
	$firstname = $_POST['firstname'];
	$birthyear = $_POST['birthyear'];

	$current_year = date('Y');

	$age = $current_year - $birthyear;

	print "<p>Your name is $firstname and you are $age years old</p>";

	if ($age > 50)
	{
		print "<p>Better start planning for Retirement!</p>";
		
		if ($firstname == 'Steve')
		{
			print "<p>Especially you Steve!<p>";
		}
	} else {
		print "<p>Keep Working!</p>";
	}

	print "<p> - END - </p>";
?>


</body>
</html>
+26 −0
Changes for Learn to Build Web Applications with PHP, MySQL, and JavaScript - Working Files/Chapter 1/X_3_2.html: 26 added lines, 0 removed lines.
Original line number Diff line number Diff line
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">

<html>
<head>
	<title>Demo 3-2</title>
	<link rel="stylesheet" href="css/X_3_2.css">
	<script src="js/X_3_2.js"></script>
</head>

<body>

<header>
	<h1>Demo 3-2</h1>
</header>

<section>

	<p>What is your name?: <input type="text" id="firstname" size="30"></p>
    <p>Guess a Number Between 1-10: <input type="text" id="firstnum" size="3"></p>
	<p><span id="message">*******</span></p>
	<p><input type="button" id="guessbutton" value="Guess a Number"></p>

</section>

</body>
</html>
 No newline at end of file
+28 −0
Changes for Learn to Build Web Applications with PHP, MySQL, and JavaScript - Working Files/Chapter 1/X_3_2_JQ.html: 28 added lines, 0 removed lines.
Original line number Diff line number Diff line
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">

<html>
<head>
	<title>Demo 3-2</title>
	<link rel="stylesheet" href="css/X_3_2.css">
    
    <script src="http://code.jquery.com/jquery-2.0.0.min.js"></script>
	<script src="js/X_3_2_JQ.js"></script>
</head>

<body>

<header>
	<h1>Demo 3-2 - jQuery</h1>
</header>

<section>

	<p>What is your name?: <input type="text" id="firstname" size="30"></p>
    <p>Guess a Number Between 1-10: <input type="text" id="firstnum" size="3"></p>
	<p><span id="message">*******</span></p>
	<p><input type="button" id="guessbutton" value="Guess a Number"></p>

</section>

</body>
</html>
 No newline at end of file
+36 −0
Changes for Learn to Build Web Applications with PHP, MySQL, and JavaScript - Working Files/Chapter 1/css/X_3_2.css: 36 added lines, 0 removed lines.
Original line number Diff line number Diff line

body {
    font-family: Arial, Helvetica, sans-serif;
    background-color: #E6E6E6;
    margin: 10 auto;
    width: 500px;
    border: 3px solid blue;
}

header {
    padding: 0 1em .5em;
}

section {
    padding: 0 1em .5em;
}

h1 {
	margin: .5em 0;
}

label {
	float: left;
    width: 10em;
    text-align: right;
    padding-bottom: .5em;
}

input {
    margin-left: 1em;
    margin-bottom: .5em;
}

#message {
	color: maroon;	
}
 No newline at end of file
Loading