[SOLVED] retrieve results from input form
Posted: Wed Feb 09, 2005 9:24 pm
i have a form where i do a search for a number, that sends the vin value to the input.php file, but i can't seem to get it take the number that i inputed, it works if i a set a value for the vin
here is the code in its entirity
here is the first page code if needed
Code: Select all
$result = mysql_query( "SELECT * FROM van WHERE vin='$vin'" )
or die("SELECT Error: ".mysql_error());Code: Select all
<?
$vin = $_REQUESTї'vin'] ;
$link = mysql_connect("211.102.211.21:3306","test","1234")or die("Connect Error: ".mysql_error());
print "Successfully connected.\n";
mysql_select_db(car , $link)
or die("Couldn't open $db: ".mysql_error());
print "Successfully connected to db.\n";
$result = mysql_query( "SELECT * FROM van WHERE vin='$vin'" )
or die("SELECT Error: ".mysql_error());
$num_rows = mysql_num_rows($result);
print "There are $num_rows records.<P>";
print "<table width=200 border=1>\n";
while ($get_info = mysql_fetch_row($result)){
print "<tr>\n";
foreach ($get_info as $field)
print "\t<td><font face=arial size=1/>$field</font></td>\n";
print "</tr>\n";
}
print "</table>\n";
mysql_close($link);
?>Code: Select all
<html>
<title>Search Page</title>
</head>
<body>
<p><font size="6">Retrieve Data Page</font></p>
<form method="POST" action="vin.php">
<p><font size="5">Please input VIN for Vehicle Search</font></p>
<p><input type="text" name="vin" size="20"></p>
<p><input type="submit" value="Submit" name="B1"><input type="reset" value="Reset" name="B2"></p>
</form>
<p> </p>
</body>
</html>