Hello all,
This must seem simple to you all, but I've been working on this for awhile and right now my mind just
does not want to function. It's just one of those days. 🙂 Anyhow...what I want to do is to take
information from a drop down menu of a form and take a value from the drop down menu and put it into
the url. From there, I need to pull the value from the url and then make whatever value that is
the corresponding db name.
First start:
<?php
//connect to db//
//submit info
if ($sub_teacher) {
$result=mysql_query("select * from '" . $_POST["teach"] . "' where teacher=$teacher") or die ("cant do it");
}
?>
My form:
<form action="<? $PHP_SELF ?>" method="post">Choose your teacher:</font>
<select class="iboxes" name="teach">
<option value="one">Teacher One
<option value="two">Teacher Two
<option value="three">Teacher Three
<option value="four">Teacher Four
<option value="five">Teacher Five
</select>
<input type="submit" value="Go" name="sub_teacher" class="st">
Now down here, I want the $dbu to equal the teacher value found within the url.
$dbu=$teacher;
$result = mysql_query("SELECT * FROM $dbu");
It works when I type in $teacher=somevalue, but I just cannot get the form to work and get the name into the url.