Show Source Code


<!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">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>Alphabetize Signs</title>

    <style>
        form
        {
            width: 400px;
            margin: 100px auto;
            margin: 1em auto;
            padding:0 2em 2em 2em ;
            border:1px solid #bbb;
            color: #333;
            background:#fdc271;
            font: 0.9em verdana, sans-serif;
        }
    </style>

</head>

<body>

<br>
<?php
include("include/inc_controlstructures.php");
?>
<h2 style="text-align:center">Alphabetize the 12 Chinese Zodiac Signs</h2>
<h5 style="text-align:center"></h5>

<h5 style="text-align:center">RAT,OX,TIGER,HARE,DRAGON,SNAKE,HORSE,GOAT,MONKEY,ROOSTER,DOG,PIG</h5>


<form name="zodiacSigns" method="post">
<p>Please enter 12 Chinese Zodiac Signs separated by a <strong>comma</strong> in random order: <input type="text" name="signs" size="40"/></p>

<br>
<br>

<p><input type="submit" name="Submit" value="Alphabetize Signs" /></p>
<p><input type="reset" value="Clear Form" /></p>&nbsp;&nbsp;




<?php

$signs 
= ($_POST['signs']); 

$SignsArray explode(","$signs);

$count count($SignsArray);

if (
$count != 12)
    echo 
"<p align='center'>You have not entered 12 zodiac signs separated by commas.</p>";


else {

    
sort($SignsArray);

    echo 
"<p>";

    for (
$i 0$i $count; ++$i) {
        echo 
$SignsArray[$i] . "<br />";
    }

echo 
"<p align='center'></p>";
}

?>
</form>
<hr>
<FORM><p align='center'><INPUT Type="button" VALUE="Go Back" onClick="history.go(-1);return true;"></p></FORM>

<br>
<?php
include("include/inc_text_links.php");
?>
<br>

</body>
</html>