Form Posting % characters
| From: | James Tower) | Date: | Fri, 28 Sep 2001 22:40:59 +0000 |
| Subject: | Form Posting % characters | ||
| Groups: | php.general | ||
| Request: | Send a blank email to php-general+get-69228@lists.php.net to get a copy of this message | ||
How can I get a select form to pass more than just value?
In the following code, I tried extended the <option value=...> with the
information I want to pass to the next page, but as written things like &
and = are converted to %??.
How can I prevent this? Or is there another way I should implement this?
CODE
print "<form method=GET action=asset.php>\n";
print "<select size=1 name=serverid>\n";
$link=mysql_connect("localhost",$user,$pass);
if ( ! $link )
die("Could Not Connect to MySQL!");
mysql_select_db($db, $link)
or die ("Could Not Open $db: ".mysql_error() );
$result=mysql_query( "SELECT ServerName, ServerID FROM TblServer");
while ($row = mysql_fetch_array ($result))
{
print "<option
value=$row[ServerID]&servername=$row[ServerName]>$row[ServerName]</option>\n
";
}
print "</select>\n";
print "<input type=submit value=\"Get Record\">\n";
print "</form>\n";
Results in:
http://www.whatever.com/assett.php?serverid=1%26servername%3DServerOne
___________________________
James C. Montz
James Tower
http://www.jamestower.com <http://www.jamestower.com>
jcmontz@jamestower.com