Page 1 of 1

[SOLVED] retrieve results from input form

Posted: Wed Feb 09, 2005 9:24 pm
by LittleBill
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

Code: Select all

$result = mysql_query( "SELECT * FROM van WHERE vin='$vin'" )
or die("SELECT Error: ".mysql_error());
here is the code in its entirity

Code: Select all

<?
  $vin = $_REQUEST&#1111;'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))&#123; 
print "<tr>\n";
foreach ($get_info as $field) 
print "\t<td><font face=arial size=1/>$field</font></td>\n";
print "</tr>\n";
&#125;
print "</table>\n";


mysql_close($link);




?>
here is the first page code if needed

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>&nbsp;</p>

</body>

</html>

Posted: Wed Feb 09, 2005 9:29 pm
by feyd
have you verified the data comes across? print_r($_REQUEST);

Posted: Wed Feb 09, 2005 9:30 pm
by djot
-
Hi,

What about using

Code: Select all

$vin = $_POST&#1111;'vin'];
instead?


djot
-

Posted: Wed Feb 09, 2005 10:21 pm
by LittleBill
fixed it thank you, had a page not correctly updated on server