Another Noob question:
I have a page working that querys a database, and it works just fine. My question is: How can I present the user with a form that they input data to, and then when they submit, jump to this page that displays the data? Here's the code I've got:
<HTML>
<HEAD>
<BODY>
<?php
//include 'xpull.inc.php';
// Set Mysql Variables
$host='localhost';
$user='xxxxxx';
$pass='xxxxxx';
$db='xxxxxx';
$table='xxxxxx';
//$xColor=$POST['XColor'];
//$xGroup=$POST['XGroup'];
$xColor='r';
$xGroup='1';
mysql_connect($host, $user, $pass) or die('Connection died!');
mysql_select_db($db) or die('Selection died!');
$get_all = "SELECT * FROM $table WHERE Color='$xColor' AND Group='$xGroup'";
$myquery = mysql_query($get_all);
while ($row = mysql_fetch_array($myquery)) {
echo $row['FName'];?><BR><?php
echo $row['LName'];?><BR><?php
echo $row['UName'];?><BR><?php
echo $row['PWord'];?><BR><?php
echo $row['EMail'];?><BR><BR><?php
}
?>
</BODY>
</HTML>
I want to have the user input the values for $xColor and $xGroup. I have a working page with the form on it - the include is commented out because I don't want the form displayed again when the results are displayed.