That would work if you had another page display the form and submit to the page that the code you posted above is in. So it would look something like this:
Code:
<form action="search.php" method="POST">
Date: <input type="text" name="bday" value="March" readonly>
<input type="submit" value="Do Search">
</form>
Then search.php would be like this (modified version of your above posted code):
Code:
<?php
/* connect to the mysql database and use a query to get the members info */
include 'library/config.php';
include 'library/opendb.php';
//navigation
include("nav.php");
$bday = $_POST['bday']; //assign the bday variable.
//birthday search
$sql = "SELECT * FROM `table` WHERE `birthday` LIKE '%$bday%'";
$info = mysql_query($sql);
echo '<table border="1" cellpadding="3" cellspacing="1">
<tr valign="top">
<td>First Name</td>
<td>Last Name</td>
<td>DateOfBirth</td>
<td>Last Login</td>
</tr>';
if (mysql_num_rows($info) < 1) {
echo '<tr valign="top">
<td colspan="4">There are no members that match the query. Please go back and try again</td>
</tr>';
}
else {
while ($qry = mysql_fetch_array($info)) {
//create the layout
?>
<link href="cs_style.css" rel="stylesheet" type="text/css" />
<tr valign="top">
<td><?php echo $qry['FirstName']; ?></td>
<td><?php echo $qry['LastName']; ?></td>
<td><?php echo $qry['DateOfBirth']; ?></td>
<td><?php echo $qry['State']; ?></td>
</tr>
<?php
}
}
echo '</table>';
?>
Hope this helps.
Bookmarks