SitePoint Sponsor

User Tag List

Results 1 to 3 of 3
  1. #1
    SitePoint Wizard
    Join Date
    Apr 2004
    Location
    dublin
    Posts
    2,036
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Big Problem! Please Help

    Hi all,

    I am really stuck on this. Basically I am creating a personal fitness site. I want to be able to create personalised programs for each person.

    I want each person to have a personalised username/password to login. Once they log in there will be a page that displays their program.

    For creating the program I want the following: The database will contain a table with names of methods such as jogging, swimming, etc.

    Each method will be displayed on the webpage with a checkbox.
    The user selects each method that they want.
    When they press submit they are taken to a page that displays further options based on the choices they picked.

    So for example, if they selected jogging and weights the following page would display num of laps, speed, weight-type, weight, etc.

    Each of these would contain a textfield so one can enter how fast they should go, etc.

    my main problem is when they select from the first set of checkboxes how do I display the data based on their selection from a database??

    Or do you guys think tht there is a much simpler way of doing this??

    Thanks.

    Kevin.

  2. #2
    SitePoint Wizard
    Join Date
    Apr 2004
    Location
    dublin
    Posts
    2,036
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Here is my php code for the first part:

    PHP Code:
    $num_results mysql_num_rows($result);
       
    echo 
    '<form id="FormName" action="training.php" method="post" name="FormName">';
       
    echo 
    'Enter clients Name:<br /><input type="text" name="name"><br />';
       
    for (
    $i=0$i<$num_results$i++)
       {
        
    $row mysql_fetch_array($result);
        echo (
    $i+1).'.'.$row['method']. '<input type="checkbox" name="rep[]" value="'.$row['method'].'">';
        echo 
    '<br />';
       } 
    This displays results such as running, weights, etc. each with a checkbox.

    Then how do I display the next set of results based on the users selection??

    Thanks.

  3. #3
    SitePoint Wizard
    Join Date
    Apr 2004
    Location
    dublin
    Posts
    2,036
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Anyone please??

    Any ideas how I should tackle this??

    Thanks.


Bookmarks

Posting Permissions

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