I have a form I am using javascript to submit. One of the variables in the form is pulled form the URL. The other variable is selected from a drop down list. the form is then submitted.
For some reason the URL ends up as:
http://localhost/inventory/inventory.php?clientid=1%5C%22%22&machid=2
Here is the code I'm using:
For the form:
<?php
// includes
include("includes/config.php");
include("includes/functions.php");
include ("includes/connect.php");
?>
<head>
<title>Untitled Document</title>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
</head>
<body bgcolor="#FFFFFF" text="#000000">
<form action="inventory.php?clientid=<?php echo "$clientid";?>&machid=<?php echo"$machid";?>"><input type="hidden" name="clientid" value=<?php echo $clientid;?>"><?php include ("queries/menulist/computernamebyclient.ph");?>
</form>
</body>
The query the populates the dropdown menu is:
<?php
// generate and execute query
$list_computername_sql = "SELECT cname,machid FROM inventory WHERE clientid='$clientid'";
$list_computername_result = mysql_query($list_computername_sql);
$numrows = mysql_num_rows($list_computername_result);
if ($numrows>0) {
while ($list = mysql_fetch_array($list_computername_result)) {
echo "<li><a href=\"inventory.php?clientid=$clientid&machid=".$list["machid"]."\">".$list["cname"]." </a><br><br></li>";
}
}else{
echo"<font face=\"arial\" size=\"3\" color=\"#CC0000\">There are no computers available at this time.</font>";
}
?>
What am I doing wrong?
Thanks.