Created
February 21, 2015 22:36
-
-
Save safranck/df87b40669f2bddb107e to your computer and use it in GitHub Desktop.
PHP 201
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
require 'inc-header.php'; | |
$chapter = ( $_GET[ 'chapter' ] ); | |
?> | |
<h3>Today is <?php echo myDate(); ?>.</h3> | |
<h1><?php echo ucwords( $chapter ); ?></h1> | |
<h2>Please select a chapter below:</h2> | |
<form action="/201.php" method="get"> | |
<select name="chapter"> | |
<option value="appetizers">Appetizers</option> | |
<option value="main dishes">Main Dishes</option> | |
<option value="cocktails">Cocktails</option> | |
<option value="desserts">Deserts</option> | |
</select> | |
<input type="submit" value="Submit"> | |
</form> | |
<?php | |
if ($chapter == 'appetizers' ) { | |
include 'appetizer.php'; | |
} elseif ($chapter == 'main dishes' ) { | |
include 'main.php'; | |
} elseif ( $chapter == 'cocktails' ) { | |
include 'cocktails.php'; | |
} elseif ($chapter == 'desserts' ) { | |
include 'desserts.php'; | |
} else { | |
echo 'Please select a chapter from above'; | |
} | |
echo '<h3>While...loop example</h3>'; | |
$counter = 1; | |
while( $counter <= 3 ) { | |
echo "The number is: $counter </br>"; | |
$counter++; | |
} | |
?> | |
<?php | |
require 'inc-footer.php'; | |
?> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment