<?
$in = $_REQUEST[in];
?>
<html>
<body bgcolor="#fad888">
<center>
Enter a hex color value<br />
<form>
<input type="text" name="in" cols="6" value="<? echo "$in" ?>" />
<input type="submit" />
</form>
<?
if ( isset($in) )
$in = strtolower($in);
{
if (
(strlen($in) == 6)
&&
(eregi("[0-9a-f][0-9a-f][0-9a-f][0-9a-f][0-9a-f][0-9a-f]", $in))
)
{
echo "$in is a color hex value";
}
else
{
echo "$in is not a color hex value";
}
}
?>
</center>
</body>
</html>