//Select client information for display
if($u == 'tslack')
{
echo "<HTML><HEAD><BODY><H1><CENTER>Tom Slack</CENTER></H1><BR>";
echo "<HTML><FORM NAME=slackform>";
echo "<CENTER><TABLE BORDER=2>";
echo "<TR><TD ALIGN=center><SELECT NAME=SlackSemester><option> </option><option>Fall</option><option>Spring</option><option>Summer</option></TD>";
echo "<TD ALIGN=center><SELECT NAME=SlackYear><option> </option><option>2003</option><option>2004</option><option>2005</option></TD></TR></CENTER>";
echo "<INPUT TYPE=submit NAME=submit VALUE='Get Data' ONSUBMIT='slack()'>";
}
$info = mysql_db_query($db, $sql_client)
or die("Invalid query: " . $sql_client . "<p>" . mysql_error());
function slack()
{
$sql_client = "SELECT * FROM formdata WHERE Instructor = 'name' ";
}
The variable $u is checked to see which person has logged in. For example, tslack as logged in. I want to be able to press a button and have his data displayed within the HTML window. Can I just call this function from onSubmit and have it run when the user clicks the button? As you can see I also have to drop down menus on the form. Once I figure out how make this function run I'll pass the drop down values as paramaters.
All in all, how can I make a function run through clicking a button?