<html>
<head>
<title>mime_lookup() example #2</title>
</head>
<body bgcolor=white>
<h1>mime_lookup() example #2</h1>
<p>Look up a MIME type.</p>
<p>You can <a href="example2.phps">view the source to this example</a>.</p>
<?
if ($submit && $ext) {
include("mime_lookup.php");
$type=mime_lookup($ext);
if ($type) {
echo "<p><strong>Found type $type for extension $ext.</strong></p>\n";
} else {
echo "<p><font color=red>No type found for extension $ext.</font></p>\n";
}
}
?>
<form method=post action=example2.php>
Extension: <input type=text name=ext>
<input type=submit value=submit name=submit>
</form>
</body>
</html>