Hello, I've got a problem. I'm trying to pass variables through multiple forms and then execute an MySQL query. All variables and forms must pass through a switch statement. Does anybody know what I'm doing wrong or if this is even possible? I'm not quite sure that I understand the array scenario here or if this thing could even work. I tried $GET['post'] and $GET['submit'].
<html>
<head>
<title></title>
</head>
<body>
<form action="<?php echo $SERVER['PHP_SELF']?>" metehod="post">
<input type="text" name="address" id="address search" /> Address<br />
<input type="submit" /><br />
</form>
<form action="<?php echo $SERVER['PHP_SELF']?>" metehod="post"><br />
<input type="text" name="pin" id="PIN search" /> PIN Number<br />
<input type="submit" /><br />
</form>
<?php
switch ($GET['post'])
{
case 'PIN search':
$pin = @$GET['pin'];
$trimmed_pin = trim($pin); //trim whitespace from the stored variable
$search = " mtg_pin LIKE '$trimmed_pin%'";
break;
case 'address search':
$address = @$_GET['address'];
$stripped_address = preg_replace("/[^a-zA-Z0-9\'\-.]/", " ", $address); //remove unwanted crap
$serach = " MATCH (mtg_address) AGAINST ('$stripped_address')";
break;
}
echo $_GET['post'];
?>
</body>
</html>