if i have...
when you submit the form it won't show the type of gun, it should show it depending on the color you type...PHP Code:<?php
function array_search_ci ($arr, $posted) {
foreach ($arr as $key => $value) {
$string =strtoupper(trim($arr[$key]));
$uppercase_it = strtoupper($posted);
if ($uppercase_it == $string) {
return $key;
}
}
}
$theircolor = $_POST['color'];
$theirtype = $_POST['type'];
$guncolor = array("black", "red", "blue", "green");
$guntype = array("shotgun", "pistol", "rifle", "musket");
array_search_ci("$guncolor", "$theircolor");
$gun=array_search_ci("$guncolor", "$theircolor");
if($_GET['act'] == "showtype") {
$showtype = $guntype[$gun];
echo $showtype;
}
?>
<form action="loginstart.php?act=showtype" method="POST">
color: <input name="color" type="text">
<INPUT TYPE="submit" VALUE="submit" NAME="submit">
</form>



Reply With Quote

Bookmarks