alicefreak Posted August 19, 2010 Share Posted August 19, 2010 Ok here is what im trying to do: 1. drop down list pulled from mysql database.( working ) 2. after you select the name in the drop down list 3. Use selected name to another page. here is code <?php include('include/db_connection.inc'); $table = "truck_master"; $result = mysql_query( "SELECT driver_name FROM $table" ); $options=""; while ($row=mysql_fetch_array($result)) { $driver_name=$row["driver_name"]; $options.="<OPTION VALUE=\"driver_name\">".$driver_name.'</option>'; } ?> <html> <head> </head> <body> <table align="center"> <form name="form1" method="GET" align="center" action="issue.php"> <tr> <td>Driver Name :</td> <td><SELECT name="driver_name"><OPTION VALUE=''>Choose<?php echo $options?></SELECT> </td> </tr> <tr> <td><input type="submit" name="Submit" value="Submit"> </td> </tr> </form> </table> </body> <html> Second Code IS $driver = $_GET['driver_name']; Quote Link to comment Share on other sites More sharing options...
Sergey Popov Posted August 19, 2010 Share Posted August 19, 2010 You need to correct this line in your code: $options.="<OPTION VALUE=\"driver_name\">".$driver_name.'</option>'; so that it look like this: $options.="<OPTION VALUE=\"".$driver_name."\">".$driver_name.'</option>'; Quote Link to comment Share on other sites More sharing options...
alicefreak Posted August 19, 2010 Author Share Posted August 19, 2010 thanks Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.