SitePoint Sponsor

User Tag List

Results 1 to 2 of 2

Thread: Check this out

  1. #1
    SitePoint Zealot
    Join Date
    Feb 2005
    Posts
    175
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Check this out

    Hi, I made a simple form in wich there a checkbox set querying a database.

    The value been proceed except that there's only one value for the checkbox set, no matter how many I checked.

    Here's the php form code;
    PHP Code:
        <?php
                    
                    
    include 'connect.php';
                    
                    
    $req "SELECT * FROM Pratique";
                    
    $resultat mysql_query($req);
                    
                    while (
    $record mysql_fetch_assoc($resultat)) {
                        echo 
    "(".$record["pratique"]." <input type='checkbox' name='pratique' value='".$record["id"]."'>)&nbsp;&nbsp;";
                    }
                
                
    ?>
    And here how it is treated :
    PHP Code:
    <?php

                $link 
    "<a href='insertFiche.php'>Retour &agrave; l'insertion de donn&eacute;es </a><br /><br />";
                
                include 
    'connect.php';
                

                
    $prenom addslashes($prenom);
                
    $nom addslashes($nom);
                
    $email addslashes($email);
                
    $modifiedBy addslashes($modifiedBy);
                
    $genre addslashes($genre);
                
    $phone addslashes($phone);
                
    $acces addslashes($acces);
                
    $poste addslashes($poste);
                
    $fax addslashes($fax);
                
    $pratique addslashes($pratique);
                
    $admission addslashes($admission);
                
    $formation addslashes($formation);
                
    $association addslashes($association);
                
    $Autres addslashes($Autres);
                
    $prenom trim($prenom);
                
    $nom trim($nom);
                
    $email trim($email);
                
    $modifiedBy trim($modifiedBy);
                
    $genre trim($genre);
                
    $phone trim($phone);
                
    $acces trim($acces);
                
    $poste trim($poste);
                
    $fax trim($fax);
                
    $pratique trim($pratique);
                
    $admission trim($admission);
                
    $formation trim($formation);
                
    $association trim($association);
                
    $Autres trim($Autres);
                
                
    $req "INSERT INTO FrCandidat (prenom, nom, email, modifiedBy, genre, phone, acces, poste, fax, pratique, admission, formation, association, Autres) VALUES ('".$prenom."','".$nom."','".$email."','".$modifiedBy."','".$genre."','".$phone."','".$acces."','".$poste."','".$fax."','".$pratique."','".$admission."','".$formation."','".$association."','".$Autres."')";
                
                
    $resultat mysql_query$req);
                
                echo 
    $req;
                
                echo 
    $link;
                
    ?>
    Any Ideas

    Thank you

  2. #2
    SitePoint Guru defiance's Avatar
    Join Date
    Oct 2004
    Location
    United states
    Posts
    663
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    cross-posting


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
  •