SitePoint Sponsor

User Tag List

Results 1 to 6 of 6

Thread: Creating forms.

  1. #1
    SitePoint Enthusiast
    Join Date
    Jun 2006
    Posts
    26
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Creating forms.

    I need to create a form, 'multiple selection' type.
    The selections need to be inserted from the database, and each of the
    selections needs become a different variable.

    If it helps, there can be a max of 6 names in the database.
    thx.

  2. #2
    SitePoint Wizard silver trophy Jelena's Avatar
    Join Date
    Feb 2005
    Location
    Universum, 3rd Corner
    Posts
    3,000
    Mentioned
    1 Post(s)
    Tagged
    0 Thread(s)
    And what is the question?
    -- Jelena --

  3. #3
    SitePoint Evangelist
    Join Date
    Jul 2004
    Location
    USA
    Posts
    594
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    I think he wants us to do it for him.
    BKerr

  4. #4
    SitePoint Enthusiast
    Join Date
    Jun 2006
    Posts
    26
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    yah, i dunno how can i insert all of the selection into different variables.

  5. #5
    SitePoint Wizard silver trophy Jelena's Avatar
    Join Date
    Feb 2005
    Location
    Universum, 3rd Corner
    Posts
    3,000
    Mentioned
    1 Post(s)
    Tagged
    0 Thread(s)
    If you could share code you have so far with us, then we might be able to help you.
    -- Jelena --

  6. #6
    SitePoint Enthusiast
    Join Date
    Jun 2006
    Posts
    26
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    well, this is the page code.

    PHP Code:
    <html><head><body text=white>
    <?php  
    include("config/db_config.php");  
    $conn mysql_connect ($db_host$db_user$db_password);  
    $db_select mysql_select_db("$db_name",$conn);  
    if (!
    $db_select){  
    die (
    "Could not select the database: <br />"mysql_error());  
    }  


    if (
    $_POST['submit']) { 
    $name1 =$_POST['clan_table1'];  
    $name2 =$_POST['clan_table2'];  
    $name3 =$_POST['pass']; 

    if (
    $name1 == $name2)
    {
    echo 
    "<br><center>don't cheat</center";
    }
    else {

    ?>


    <br><br>
                <TABLE border=0 align=center>
                <TR>    
                <TD> <font color=red>WINNERS </font></TD>
                
                
                
                <TD width=100></TD>
                
                
                <TD><font color=red>LOSERS</font></TD>
                </TR>
                <tr>
                <td>
                
    <?php    
    $query 
    "select user from $playerstable where name = '$name1'"
    $result mysql_query($query); 
    ?>
    <form method="post" action=" <?php echo "rep3.php";?>">
    <?php
    while(list($name) = mysql_fetch_row($result)){ 
    echo 
    "<input type=checkbox value='$name'>$name <br>"

    ?>

    </td>
    <td width=100></td><td>
    <?php
    $query 
    "select user from $playerstable where name = '$name2'"
    $result mysql_query($query); 
    while(list(
    $names) = mysql_fetch_row($result)){ 
    echo 
    "<input type=checkbox value='$names'>$names <br>"

    ?>


    </td></tr>
                </TABLE>
        <input type="Submit" name="submit" value="NEXT" style="border: 1 solid" class="text">
            
    </form>            </body>
                </head>
                </html>
                <?php
                
    }
                 }
                 
    ?>
    password checking and more is missing, but it doesn't matter at this point.
    You need to pick the winners and losers, but i want to use each of the selections, that's why i need each 1 of them as a variable. at this point, they are just useless.
    Last edited by aleminio; Jul 18, 2006 at 15:05.


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
  •