Hello and welcome to our community! Is this your first visit?
Register
Enjoy an ad free experience by logging in. Not a member yet? Register.
Results 1 to 3 of 3
  1. #1
    Regular Coder
    Join Date
    Jun 2002
    Location
    London, UK
    Posts
    127
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Exclamation Urgent - Please help

    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

  • #2
    Regular Coder
    Join Date
    Jun 2002
    Location
    London, UK
    Posts
    127
    Thanks
    0
    Thanked 0 Times in 0 Posts
    rest.txt is a tab separated text file with 3 elements per line: restaurant_name, cuisine, and review. Just to clarify.

    Any suggestions??

    DH

  • #3
    New Coder
    Join Date
    Jan 2003
    Location
    Lisbon / Portugal
    Posts
    36
    Thanks
    0
    Thanked 0 Times in 0 Posts
    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....


  •  

    Posting Permissions

    • You may not post new threads
    • You may not post replies
    • You may not post attachments
    • You may not edit your posts
    •