I have this search form with php script to retrieve the data being searched for. I am Google-learning html and php and got this code from someone else. I have adapted it to my needs and I don't think it is my adaptations. When I select the category and put in my criteria there appears to be no way to submit my inputs.
I need some help figuring out how to submit. Thanks for any help you can give.
Code:
<html>
<head>
<title>Member Lookup</title>
<style type="text/css">
table{
background-color: #FCF;
}
th{
width: 150px;
text-align: left;
}
</style>
</head>
<body>
<h1>Search Membership</h1>
<form method="post" action="Search2.php">
<input type="hidden" name="submitted" value="true" />
<label>Search Category:
<select name="category">
<option value="FName">First Name</option>
<option value="LName">Last Name</option>
<option value="City">City</option>
<option value="State">State</option>
<option value="ChapterName">Chapter Name</option>
<option value="ChapterNumber">Chapter Number</option>
</select>
</label>
<label>Search Criteria: <input type="text" name="criteria /></label>
<input type="submit" />
</form>
<?php
if (isset($_Post['submitted'])) {
//Connect to the database
$include('connect.php');
$category = $_Post['category'];
$criteria = $_Post['criteria'];
$query = "Select * FROM Member WHERE $category = '$criteria'";
$result = mysqli_query($dbcon, $query) or die('Could not connect');
echo "<table>";
echo "<tr><th>Member Number</th><th>First Name</th><th>Laast Name</th><th>Address</th><th>Address2</th><th>City</th><th>State</th><th>Zip</th><th>Phone</th><th>Chapter</th><th>Chapter Number</th></tr>";
while($row = mysqli_fetch_array($result, MYSQLI_ASSOC)){
echo "<tr><td>";
echo $row['MemberNumber'];
echo "</td><td>";
echo $row['FName'];
echo "</td><td>";
echo $row['LName'];
echo "</td><td>";
echo $row['Address'];
echo "</td><td>";
echo $row['Address2'];
echo "</td><td>";
echo $row['City'];
echo "</td><td>";
echo $row['State'];
echo "</td><td>";
echo $row['Zip'];
echo "</td><td>";
echo $row['Phone'];
echo "</td><td>";
echo $row['Chapter'];
echo "</td><td>";
echo $row['ChapterNumber'];
echo "</td></tr>";
}
echo "</table>";
}//end of main if statement
?>
</body>
</html>