|
Posted by chrisollar on 12/30/06 22:48
I've got two files.
start.php and finish.php
when I query the mysql database the combo box displays great. But when
I try to pass the information on to the next page I only get the first
word of the field if there are more than one words.
I'm sure that it's something to do with the white spaces. I'm hoping to
find some simple yet elegant help.
Here's start.php
<html>
<head>
<title>Radiator Part Number Search</title>
</head>
<body>
<h3>Start by selecting your Make and then clicking "Submit"</h3>
<?php
mysql_connect("localhost", "login", "password") or die(mysql_error());
//echo "Connected to MySQL<br />";
mysql_select_db("fotechtx_radiator") or die(mysql_error());
//echo "Connected to Radiator Database";
$query="SELECT DISTINCT make FROM radiator ORDER BY make ASC";
$result = mysql_query ($query);
echo "<form name=form method=post action=finish.php>";
echo "Make</br>";
echo "<select name=carmake value=''>Select Make</option>";
while($nt=mysql_fetch_array($result)){
echo "<option value=$nt[make]>[make]</option>";
//\"".$row["adres"]."\">,
}
echo "</select>";
echo "<p> <input type=submit name=Submit value=Submit>";
echo "<input type=reset name=Reset value=Reset>
</p>";
echo "</form>";
?>
</body>
</html>
And here is finish.php:
<html>
<head>
<title>Radiator Part Number Search</title>
</head>
<body>
<h3>Now Select your Model and press Submit</h3>
<?php
// echo "<p>Make: " . $_POST['carmake']."</p>\n";
//echo "<p>listbox: " . $_POST['listbox'] . "</p>\n";
$make_value = $_POST["carmake"];
echo "$make_value";
//echo "$make_value ";
//foreach ($values as $a){
// echo $a;
//}
//echo "</p>\n";
?>
<?php
//echo "$make_value ";
mysql_connect("localhost", "login", "password") or die(mysql_error());
//echo "Connected to MySQL<br />";
mysql_select_db("fotechtx_radiator") or die(mysql_error());
//echo "Connected to Radiator Database";
$query="SELECT DISTINCT HEADING FROM radiator WHERE MAKE= '$make_value'
ORDER BY HEADING";
$result = mysql_query ($query);
echo "<form name=form method=post action=more.php>";
echo "Make</br>";
echo "<select name=carmake value=''>Make Selected</option>";
echo "<option value=$make_value>$make_value</option>";
echo "</select>";
echo "</br>";
echo "</br>";
echo "</br>";
echo "Model</br>";
echo "<select name=carheading value=''>Select Model</option>";
while($nt=mysql_fetch_array($result)){
echo "<option value=$nt[HEADING]>$nt[HEADING]</option>";
}
echo "</select>";
echo "<p> <input type=submit name=Submit value=Submit>";
echo "<input type=reset name=Reset value=Reset>
</p>";
echo "</form>"
?>
</body>
</html>
I greatly appreciste any help.
Chris
Navigation:
[Reply to this message]
|