I've got my search working perfectly!! But when I do a search, everything has the same URL. They all have the name of the PHP page... results.php. How do I make the URL so I can link to it, make the URL unique to a query. Do I make sense? Been programming all night at this! I would really appreciate any help!!
How about this for some major help... first person who solves this, post your contact info and I'll mail you a bunch of CDs.
SEARCH FORM:
<form action="http://www.nowontour.com/results.php" onSubmit="return submitIt(this)" method="post">
<table border="0" cellspacing="0" cellpadding="0">
<tr>
<td colspan="3"><span class="text">Search by:
<input type="radio" name="show" value="toursArtist" checked>Artist
<input type="radio" name="show" value="toursCity">City
<input type="radio" name="show" value="toursVenue">Venue</span><br><img src="http://www.nowontour.com/img/spacer.gif" width="1" height="5" border="0" alt=""><br></td>
<td rowspan="2"><img src="http://www.nowontour.com/img/spacer.gif" width="20" height="1" border="0" alt=""><br></td>
<td bgcolor="#003366" rowspan="2"><img src="http://www.nowontour.com/img/spacer.gif" width="1" height="1" border="0" alt=""><br></td>
<td rowspan="2"><img src="http://www.nowontour.com/img/spacer.gif" width="20" height="1" border="0" alt=""><br></td>
<td rowspan="2"><span class="text">Submit:<br>
<a href="http://www.nowontour.com/tour.php">Tour Dates</a><br>
<a href="http://www.nowontour.com/venue.php">Venue Information</a></span></td>
</tr>
<tr>
<td valign="top"><input type="text" name="search" size="20" maxlength="50"></td>
<td><img src="http://www.nowontour.com/img/spacer.gif" width="5" height="1" border="0" alt=""><br></td>
<td valign="top"><input type="image" src="http://www.nowontour.com/img/but_search.gif" width="55" height="21" border="0" value="Search"></td>
</tr>
</table>
</td>
</tr>
<tr>
<td bgcolor="#003366" colspan="3"><img src="http://www.nowontour.com/img/spacer.gif" width="1" height="1" border="0" alt=""><br></td>
</tr>
<tr>
<td colspan="3"><img src="http://www.nowontour.com/img/spacer.gif" width="1" height="1" border="0" alt=""><br></td>
</tr>
</form>
RESULTS.PHP PAGE:
<?
$search = $HTTP_POST_VARS['search'];
$show = $HTTP_POST_VARS['show'];
?>
<?php
$location = "localhost";
$username = "";
$password = "";
$database = "";
$conn = mysql_connect("$location","$username","$password");
if (!$conn) die ("Could not connect MySQL");
mysql_select_db($database,$conn) or die ("Could not open database");
$color1 = "#ffffff";
$color2 = "#cccccc";
$row_count = 0;
$result=mysql_query("SELECT * FROM tours WHERE $show = '$search'") or die ("No results found.");
if (mysql_num_rows($result)<1){
echo "<table border='0' cellspacing='0' cellpadding='0' width='750'><tr><td class='text'><strong>The results of your search:</strong><br><br>Sorry, no matches could be found at this time.<br><br>*Make sure you spelled your search correctly.</td></tr></table>";
} else {
$num = mysql_num_rows($result);
$cur = 1;
echo "<table border='0' cellspacing='0' cellpadding='0' width='750'><tr><td><table border='0' cellspacing='1' cellpadding='2' width='100%'><tr><td colspan='5' class='text'>The results of your search:<br><br></td></tr><tr><td class='text'><strong>Artist</strong></td><td class='text'><strong>Date</strong></td><td class='text'><strong>City/ State</strong></td><td class='text'><strong>Venue</strong></td></tr>";
while ($num >= $cur) {
$row = mysql_fetch_array($result);
$artist = $row["toursArtist"];
$date = $row["toursDate"];
$city = $row["toursCity"];
$state = $row["toursState"];
$venue = $row["toursVenue"];
$row_color = ($row_count % 2) ? $color1 : $color2;
echo "<tr><td bgcolor=$row_color class='text'>$artist</td><td bgcolor=$row_color class='text'>$date</td><td bgcolor=$row_color class='text'>$city, $state</td><td bgcolor=$row_color class='text'>$venue</td></tr>";
$cur++;
$row_count++;
}
echo "</table></td></tr></table>";
}
mysql_close($conn);
?>