[SOLVED] retrieve results from input form

PHP programming forum. Ask questions or help people concerning PHP code. Don't understand a function? Need help implementing a class? Don't understand a class? Here is where to ask. Remember to do your homework!

Moderator: General Moderators

Post Reply
LittleBill
Forum Newbie
Posts: 12
Joined: Wed Jan 26, 2005 10:42 pm

[SOLVED] retrieve results from input form

Post 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>
User avatar
feyd
Neighborhood Spidermoddy
Posts: 31559
Joined: Mon Mar 29, 2004 3:24 pm
Location: Bothell, Washington, USA

Post by feyd »

have you verified the data comes across? print_r($_REQUEST);
djot
Forum Contributor
Posts: 313
Joined: Wed Jan 14, 2004 10:21 am
Location: planet earth
Contact:

Post by djot »

-
Hi,

What about using

Code: Select all

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


djot
-
LittleBill
Forum Newbie
Posts: 12
Joined: Wed Jan 26, 2005 10:42 pm

Post by LittleBill »

fixed it thank you, had a page not correctly updated on server
Post Reply