Newbie PAssing $variables in URL
| From: | Bobby Rahman | Date: | Mon, 28 Apr 2003 02:43:52 +0000 |
| Subject: | Newbie PAssing $variables in URL | ||
| Groups: | php.general | ||
| Request: | Send a blank email to php-general+get-145465@lists.php.net to get a copy of this message | ||
Hiya all,
Every thread talk about pairs such as test.php?var1=bla
I want to send the contents of a variable $project which is selected from a drop down box within the script.
AS the option of the drop down box may change how can I do this:
I am sort of trying to send test.php?var1=$project.
Does anyone know how to do this?
Here is the code for the project drop down box
<select name="projname">
<option value="Project_name">project</option>
<?
$projquerystring = "SELECT projname from project";
$db_result = mysql_query($projquerystring);
$db_fetch = mysql_fetch_assoc($db_result);
$db_totalrows = mysql_num_rows($db_result);
do
{
?>
<option value="<? echo $db_fetch['projname']?>"><? echo $db_fetch['projname']?></option>
<?
}
while ($db_fetch = mysql_fetch_assoc($db_result));
$rows = mysql_num_rows($db_result);
if($rows > 0) {
mysql_data_seek($db_result, 0);$db_fetch = mysql_fetch_assoc($db_result); } mysql_free_result($db_result); ?> HERE IS WHAT I WANT TO SEND TO NEXT SCREEN <p><a href="new_bug_form.php?projname=$projname">add bug</a></p> Thanx Bob _________________________________________________________________ Stay in touch with absent friends - get MSN Messenger http://www.msn.co.uk/messenger