ThePiston
Worker


Joined: Dec 22, 2004
Posts: 135
|
Posted:
Sat Jan 29, 2005 4:30 pm |
|
I'm sending a form result into a php script...
this is the form code (note the form action="search.php")
Code:<form action="search.php" method="post">
<fieldset>
<legend><h3>Please select an area of Central Virginia where you wish to find an Optometrist</h3>
<p>
<input type="checkbox" name="locids[]" value="8">
Richmond City/Fan Area<br>
<input type="checkbox" name="locids[]" value="1">
Far West End (Short Pump, Goochland, etc.)<br>
<input type="checkbox" name="locids[]" value="2">
Near West End (Willow Lawn, Parham Rd.)<br>
<input type="checkbox" name="locids[]" value="3">
North (Ashland, Hanover, etc.) <br>
<input type="checkbox" name="locids[]" value="4">
South
(Midlothian, Chester, etc.) <br>
<input type="checkbox" name="locids[]" value="5">
East End <br>
<input type="checkbox" name="locids[]" value="6">
Colonial Heights/Petersburg/Hopewell<br>
<input type="checkbox" name="locids[]" value="7">
Mineral/Louisa<br>
</p>
</fieldset>
<input value="Search Doctors" type="submit" >
</form>
|
this is the search code
Code:<?php
require_once("mainfile.php");
$numElements = count($locids);
for($counter=0; $counter < $numElements; $counter++)
{
value
if($locations == "") {
$locations = $locids[$counter];
}
else {
$locations = $locations.",".$locids[$counter];
}
}
$result = $db->sql_query("select u.name, o.offname, o.add1, o.add2, o.city, o.state, o.zip, o.phone, o.fax FROM nuke_users u, offices o, locationcodes l WHERE u.user_id = o.userid and o.locationid = l.locationid AND l.locationid IN ($locations)");
= '$area'");
("SELECT *users_office3* FROM nuke_users IF users_location3 = '$area'");
("SELECT *users_office4* FROM nuke_users IF users_location4 = '$area'");
("SELECT *users_office5* FROM nuke_users IF users_location5 = '$area'"); */
$num = $db->sql_numrows($result);
while($row=mysql_fetch_assoc($result)) {
echo "<center>$row[name], $row[offname], $row[add1], $row[add2], $row[city], $row[state], $row[zip], $row[phone], $row[fax]</center> ";
}
[user_office5]
mysql_free_result($result);
exit;
?>
|
If I use "search.php" in the form code then that "search.php" page comes up in a page outside of nuke... I put the search code into a "comments" page and instead of "search.php" I replaces "search.php" with the new "comments" url I created so the results couwl come up inside nuke, but the code was simply output as text on the comments page... no results. Is there a way I can have my results come out inside a nuke page? |
|
|