View Full Version : Urgent - Please help

01-22-2003, 02:32 AM

can someone help me witht his problem as soon as possible, thank you.

I have the following script but I can't find a way to have the input buttons display one set of restaurants by cuisine at a time as each radio button is clicked. I guess I should put the input buttons inside the loop, and probably give them a value like $buttons

h1, h2, h3 {font-family: sans-serif; text-align: center}
dt {font-weight: bold}

<input type='radio' name='cuisine' value='alsatian'>Alsatian
<input type='radio' name='cuisine' value='italian'>Italian
<input type='radio' name='cuisine' value='british'>British
<input type='radio' name='cuisine' value='french'>French
<input type='radio' name='cuisine' value='indian'>Indian

$remember = "";
$restaurant = file("rest.txt");
foreach ($restaurant as $record) {
list($restname, $cuisine, $review) = split ("\t",$record,3);
if ($cuisine != $remember) {
print "</dl><h3>$cuisine</h3><dl>";
$remember = $cuisine;
print "<dt>$restname</dt><dd>$review</dd>";



Can you please help me,



01-22-2003, 09:28 AM
rest.txt is a tab separated text file with 3 elements per line: restaurant_name, cuisine, and review. Just to clarify.

Any suggestions??


01-22-2003, 09:51 AM
i didnīt really understand what you want do to, but if is to change some values as the client clicks on a radio button i think you should use javascript.

maybe if you could explain better or give an example....