dhtmlhelp
01-22-2003, 02:32 AM
Hi,
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
<html><head><title>radiobuttons.php</title>
<style>
h1, h2, h3 {font-family: sans-serif; text-align: center}
dt {font-weight: bold}
</style></head>
<body><h1>Reviews</h1><dl>
<center>
<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
</center>
<?
$buttons
$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>";
};
?>
</dl></body></html>
Can you please help me,
thanks,
DH
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
<html><head><title>radiobuttons.php</title>
<style>
h1, h2, h3 {font-family: sans-serif; text-align: center}
dt {font-weight: bold}
</style></head>
<body><h1>Reviews</h1><dl>
<center>
<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
</center>
<?
$buttons
$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>";
};
?>
</dl></body></html>
Can you please help me,
thanks,
DH