<!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" xml:lang="en" lang="en">
<head>
<title>Jem's Alphabetti Script</title>
<style type="text/css">
* {
font: 11px/16px 'Lucida Grande', Verdana, Arial, Sans-Serif;
}
</style>
</head>
<body>
<?php
if (isset($_GET['p']) && $_GET['p'] == process) {
foreach($_POST['letter'] as $value) {
$value = strtolower($value);
if ($value > 1) {
exit("<p>Only one letter per box please.</p>");
} elseif (ereg("^[a-z0-9]$", $value)) {
echo "<img src='alpha/$value.gif' alt='$value' />";
}
}
exit;
}
?>
<form action="script.php?p=process" method="post">
<?php
for ($i=1; $i<=10; $i++) {
echo "<input type='text' name='letter[]' maxlength='1' /> Letter $i<br />";
}
?>
<input type="submit" value="Submit" />
</form>
</body>
</html>