IdentifiantMot de passe
Loading...
Mot de passe oublié ?Je m'inscris ! (gratuit)
Navigation

Inscrivez-vous gratuitement
pour pouvoir participer, suivre les réponses en temps réel, voter pour les messages, poser vos propres questions et recevoir la newsletter

PHP & Base de données Discussion :

faire un post en php


Sujet :

PHP & Base de données

  1. #1
    Membre averti
    Profil pro
    Inscrit en
    Juillet 2010
    Messages
    15
    Détails du profil
    Informations personnelles :
    Localisation : Belgique

    Informations forums :
    Inscription : Juillet 2010
    Messages : 15
    Par défaut faire un post en php
    Bonjour à tous,

    J'ai besoin de votre savoir car je n'arrive pas à faire un post en php car j'ai un code en qui recupére des données sur une carte à puce et qui les affiches en HTML ce qui fonctionne tres bien mais je n'arrive pas à faire un post avec ces fameuses données récupérées.

    Code : Sélectionner tout - Visualiser dans une fenêtre à part
    1
    2
    3
    4
    5
    6
    7
    8
    9
     
     
    <FORM Method="POST" Action="test.php3">
     
    <td class="labelText" align="right" width="150" nowrap>&nbsp;Name:&nbsp;</td>
     
    <td class="dataText" id="nameField" name="nameField" align="left" nowrap>&nbsp;</td>	
     
    </FORM>
    Comment puis-je faire pour faire pour transmettre la valaur de ce champ via un syteme de type post ?

    Merci beaucoup

  2. #2
    Expert confirmé
    Avatar de Séb.
    Profil pro
    Inscrit en
    Mars 2005
    Messages
    5 360
    Détails du profil
    Informations personnelles :
    Âge : 48
    Localisation : France

    Informations professionnelles :
    Secteur : High Tech - Opérateur de télécommunications

    Informations forums :
    Inscription : Mars 2005
    Messages : 5 360
    Billets dans le blog
    17
    Par défaut
    Tu veux faire un POST avec formulaire ou sans formulaire HTML ?

  3. #3
    Membre averti
    Profil pro
    Inscrit en
    Juillet 2010
    Messages
    15
    Détails du profil
    Informations personnelles :
    Localisation : Belgique

    Informations forums :
    Inscription : Juillet 2010
    Messages : 15
    Par défaut
    je pense que c'est sans formulaire, car les données apparaissenet d'elles mêmes suite à la fonction de lecture de la carte.

    le code fait apparaitre ceci :

    Name: Dupont

    et je voudrai faire un post avec "Dupont"

  4. #4
    Expert confirmé
    Avatar de Séb.
    Profil pro
    Inscrit en
    Mars 2005
    Messages
    5 360
    Détails du profil
    Informations personnelles :
    Âge : 48
    Localisation : France

    Informations professionnelles :
    Secteur : High Tech - Opérateur de télécommunications

    Informations forums :
    Inscription : Mars 2005
    Messages : 5 360
    Billets dans le blog
    17
    Par défaut
    Le serveur pourrait peut-être directement interroger la carte à puce et afficher le résultat sur une page web. Non ?

  5. #5
    Membre averti
    Profil pro
    Inscrit en
    Juillet 2010
    Messages
    15
    Détails du profil
    Informations personnelles :
    Localisation : Belgique

    Informations forums :
    Inscription : Juillet 2010
    Messages : 15
    Par défaut
    non, ce qu'il me faudrai c'est vraiement faire un post de ces données pour les mettre dans un SGBD.

  6. #6
    Expert confirmé
    Avatar de Séb.
    Profil pro
    Inscrit en
    Mars 2005
    Messages
    5 360
    Détails du profil
    Informations personnelles :
    Âge : 48
    Localisation : France

    Informations professionnelles :
    Secteur : High Tech - Opérateur de télécommunications

    Informations forums :
    Inscription : Mars 2005
    Messages : 5 360
    Billets dans le blog
    17
    Par défaut
    Et pourquoi passer par un POST et ne pas appeler directement le SGBD depuis le script ?

  7. #7
    Modérateur
    Avatar de sabotage
    Homme Profil pro
    Inscrit en
    Juillet 2005
    Messages
    29 208
    Détails du profil
    Informations personnelles :
    Sexe : Homme

    Informations forums :
    Inscription : Juillet 2005
    Messages : 29 208
    Par défaut
    Qu'est ce qui ne te va pas avec le formulaire que tu nous montres ?
    N'oubliez pas de consulter les FAQ PHP et les cours et tutoriels PHP

  8. #8
    Membre averti
    Profil pro
    Inscrit en
    Juillet 2010
    Messages
    15
    Détails du profil
    Informations personnelles :
    Localisation : Belgique

    Informations forums :
    Inscription : Juillet 2010
    Messages : 15
    Par défaut
    le code fonctionne tres bien mais je ne sais pas faire un post avec c'est tout

  9. #9
    Modérateur
    Avatar de sabotage
    Homme Profil pro
    Inscrit en
    Juillet 2005
    Messages
    29 208
    Détails du profil
    Informations personnelles :
    Sexe : Homme

    Informations forums :
    Inscription : Juillet 2005
    Messages : 29 208
    Par défaut
    Il manque un bouton submit.
    N'oubliez pas de consulter les FAQ PHP et les cours et tutoriels PHP

  10. #10
    Expert confirmé
    Avatar de Séb.
    Profil pro
    Inscrit en
    Mars 2005
    Messages
    5 360
    Détails du profil
    Informations personnelles :
    Âge : 48
    Localisation : France

    Informations professionnelles :
    Secteur : High Tech - Opérateur de télécommunications

    Informations forums :
    Inscription : Mars 2005
    Messages : 5 360
    Billets dans le blog
    17
    Par défaut
    Pour un POST sans formulaire il faut construire la requête HTTP :

    Code : Sélectionner tout - Visualiser dans une fenêtre à part
    1
    2
    3
    4
    5
    6
    7
    POST /chemin/vers/script.php HTTP/1.1
    Host: www.serveur.net
    Content-Type: application/x-www-form-urlencoded
    Content-Length: 7
    Connection: close
     
    foo=bar
    Et la soumettre au serveur avec la bibliothèque sockets ( http://php.net/sockets ) par exemple.
    Il existe d'autres bibliothèques de plus haut niveau telles cURL ( http://php.net/curl ) ou HTTP ( http://php.net/http ).

  11. #11
    Membre averti
    Profil pro
    Inscrit en
    Juillet 2010
    Messages
    15
    Détails du profil
    Informations personnelles :
    Localisation : Belgique

    Informations forums :
    Inscription : Juillet 2010
    Messages : 15
    Par défaut
    N'y aurait il pas moyen de ne pas recourir au socket en mettant la valeur du champ en champ hidden ?

    Code : Sélectionner tout - Visualiser dans une fenêtre à part
    1
    2
    3
    4
    5
    6
    7
    8
    9
    10
    11
    12
    
    <FORM Method="POST" Action="test.php3">
     
    <td class="labelText" align="right" width="150" nowrap>&nbsp;Name:&nbsp;</td>
     
    <td class="dataText" id="nameField" name="nameField" align="left" nowrap>&nbsp;</td>
    
    <input type="hidden"  name="nameField"  value="valeur du champs du dessus">
    
    <input type="submit" value="Envoyer">
    </FORM>
    si oui comment ?

  12. #12
    Expert confirmé
    Avatar de Séb.
    Profil pro
    Inscrit en
    Mars 2005
    Messages
    5 360
    Détails du profil
    Informations personnelles :
    Âge : 48
    Localisation : France

    Informations professionnelles :
    Secteur : High Tech - Opérateur de télécommunications

    Informations forums :
    Inscription : Mars 2005
    Messages : 5 360
    Billets dans le blog
    17
    Par défaut
    Oui c'est possible :

    Code : Sélectionner tout - Visualiser dans une fenêtre à part
    1
    2
    <input type="hidden"  name="nameField"
    value="<?php echo $variableContentenantLaValeurDuChampDuDessus ?>">

  13. #13
    Membre averti
    Profil pro
    Inscrit en
    Juillet 2010
    Messages
    15
    Détails du profil
    Informations personnelles :
    Localisation : Belgique

    Informations forums :
    Inscription : Juillet 2010
    Messages : 15
    Par défaut
    mais la variable est issue de javascript, veux tu tout le code de ma page ?

  14. #14
    Expert confirmé
    Avatar de Séb.
    Profil pro
    Inscrit en
    Mars 2005
    Messages
    5 360
    Détails du profil
    Informations personnelles :
    Âge : 48
    Localisation : France

    Informations professionnelles :
    Secteur : High Tech - Opérateur de télécommunications

    Informations forums :
    Inscription : Mars 2005
    Messages : 5 360
    Billets dans le blog
    17
    Par défaut
    Si tu veux valoriser un champ de formulaire avec une variable JS alors c'est un pb de JS, pas de PHP

    Dans l'idée il faut faire en JS :

    Code : Sélectionner tout - Visualiser dans une fenêtre à part
    document.forms[0].nameField.value = variableJavascriptContenantLaValeur ;

  15. #15
    Membre averti
    Profil pro
    Inscrit en
    Juillet 2010
    Messages
    15
    Détails du profil
    Informations personnelles :
    Localisation : Belgique

    Informations forums :
    Inscription : Juillet 2010
    Messages : 15
    Par défaut
    et comment puis-je faire pour la mettre dans le post ?

  16. #16
    Modérateur
    Avatar de sabotage
    Homme Profil pro
    Inscrit en
    Juillet 2005
    Messages
    29 208
    Détails du profil
    Informations personnelles :
    Sexe : Homme

    Informations forums :
    Inscription : Juillet 2005
    Messages : 29 208
    Par défaut
    Il faudrait que tu commences par définir exactement ce que tu veux faire.
    Il est très peu problable que les valeurs viennent de javascript : je vois mal comment il pourrait aller interroger un lecteur de carte.

    Donc déjà sans savoir ce que tu as au départ, il va être difficile de te guider vers ce que tu veux obtenir.

    Depuis une page web il y a deux solutions pour envoyer des données post : un formulaire ou du javascript (je pense en particulier a xmlhttprequest).
    Depuis le serveur PHP, tu peux egalement simuler un envoi POST avec cURL par exemple.
    N'oubliez pas de consulter les FAQ PHP et les cours et tutoriels PHP

  17. #17
    Membre averti
    Profil pro
    Inscrit en
    Juillet 2010
    Messages
    15
    Détails du profil
    Informations personnelles :
    Localisation : Belgique

    Informations forums :
    Inscription : Juillet 2010
    Messages : 15
    Par défaut
    Voici ma page, je veux simplement envoyer les données qui y sont présente pour les recupérer en php pour les insérées dans une Base de données. le code ici fonctionne mais je n'arrive pas à faire le post

    Code : Sélectionner tout - Visualiser dans une fenêtre à part
    1
    2
    3
    4
    5
    6
    7
    8
    9
    10
    11
    12
    13
    14
    15
    16
    17
    18
    19
    20
    21
    22
    23
    24
    25
    26
    27
    28
    29
    30
    31
    32
    33
    34
    35
    36
    37
    38
    39
    40
    41
    42
    43
    44
    45
    46
    47
    48
    49
    50
    51
    52
    53
    54
    55
    56
    57
    58
    59
    60
    61
    62
    63
    64
    65
    66
    67
    68
    69
    70
    71
    72
    73
    74
    75
    76
    77
    78
    79
    80
    81
    82
    83
    84
    85
    86
    87
    88
    89
    90
    91
    92
    93
    94
    95
    96
    97
    98
    99
    100
    101
    102
    103
    104
    105
    106
    107
    108
    109
    110
    111
    112
    113
    114
    115
    116
    117
    118
    119
    120
    121
    122
    123
    124
    125
    126
    127
    128
    129
    130
    131
    132
    133
    134
    135
    136
    137
    138
    139
    140
    141
    142
    143
    144
    145
    146
    147
    148
    149
    150
    151
    152
    153
    154
    155
    156
    157
    158
    159
    160
    161
    162
    163
    164
    165
    166
    167
    168
    169
    170
    171
    172
    173
    174
    175
    176
    177
    178
    179
    180
    181
    182
    183
    184
    185
    186
    187
    188
    189
    190
    191
    192
    193
    194
    195
    196
    197
    198
    199
    200
    201
    202
    203
    204
    205
    206
    207
    208
    209
    210
    211
    212
    213
    214
    215
    216
    217
    218
    219
    220
    221
    222
    223
    224
    225
    226
    227
    228
    229
    230
    231
    232
    233
    234
    235
    236
    237
    238
    239
    240
    241
    242
    243
    244
    245
    246
    247
    248
    249
    250
    251
    252
    253
    254
    255
    256
    257
    258
    259
    260
    261
    262
    263
    264
    265
     
     
    html>
    <head>
    <meta http-equiv="Content-Type" content="text/html; charset=utf-8">
     
    <title>
    Belgian EID Card
    </title>
     
    <script language="javascript">
        function getIDData()
        {
            var strTemp;
            var strTemp2;
            var strTemp3;
     
            strTemp = document.BEIDApplet.getCardNumber() + "&nbsp;";
            document.getElementById('cardNumberField').innerHTML = strTemp;
            strTemp = document.BEIDApplet.getChipNumber() + "&nbsp;";
            document.getElementById('chipNumberField').innerHTML = strTemp;
            strTemp = document.BEIDApplet.getValidityDateBegin() + "&nbsp;";
            document.getElementById('valBeginField').innerHTML = strTemp;
            strTemp = document.BEIDApplet.getValidityDateEnd() + "&nbsp;";
            document.getElementById('valEndField').innerHTML = strTemp;
            strTemp = document.BEIDApplet.getIssMunicipality() + "&nbsp;";
            document.getElementById('issMunicField').innerHTML = strTemp;
            strTemp = document.BEIDApplet.getNationalNumber() + "&nbsp;";
            document.getElementById('natNumberField').innerHTML = strTemp;
            strTemp = document.BEIDApplet.getName() + "&nbsp;";
            document.getElementById('nameField').innerHTML = strTemp;
            strTemp = document.BEIDApplet.getFirstName1();
            strTemp2 = document.BEIDApplet.getFirstName2();
            strTemp3 = document.BEIDApplet.getFirstName3();
            document.getElementById('firstNamesField').innerHTML = strTemp + " " + strTemp2 + " " + strTemp3 + "&nbsp;";
            strTemp = document.BEIDApplet.getNationality() + "&nbsp;";
            document.getElementById('natField').innerHTML = strTemp;
            strTemp = document.BEIDApplet.getBirthLocation() + "&nbsp;";
            document.getElementById('birthLocField').innerHTML = strTemp;
            strTemp = document.BEIDApplet.getBirthDate() + "&nbsp;";
            document.getElementById('birthDateField').innerHTML = strTemp;
            strTemp = document.BEIDApplet.getSex() + "&nbsp;";
            document.getElementById('sexField').innerHTML = strTemp;
            document.BEIDApplet.getNobleCondition();
            document.BEIDApplet.getWhiteCane();
            document.BEIDApplet.getYellowCane();
            document.BEIDApplet.getExtendedMinority();
        }
     
        function getAddressData()
        {
    	  var strTemp;
            var strTemp2;
            var strTemp3;
            strTemp = document.BEIDApplet.getStreet();
            strTemp2 = document.BEIDApplet.getStreetNumber();
            strTemp3 = document.BEIDApplet.getBoxNumber();
            document.getElementById('streetField').innerHTML = strTemp + " " + strTemp2 + " " + strTemp3 + "&nbsp;";
            strTemp = document.BEIDApplet.getZip();
            strTemp2 = document.BEIDApplet.getMunicipality();
            document.getElementById('municField').innerHTML = strTemp + " " + strTemp2 + "&nbsp;";
            strTemp = document.BEIDApplet.getCountry();
            document.getElementById('countryField').innerHTML = strTemp + "&nbsp;";
        }
        function EmptyScreen()
        {
            var strTemp = "&nbsp;";
            document.getElementById('cardNumberField').innerHTML = strTemp;
            document.getElementById('chipNumberField').innerHTML = strTemp;
            document.getElementById('valBeginField').innerHTML = strTemp;
            document.getElementById('valEndField').innerHTML = strTemp;
            document.getElementById('issMunicField').innerHTML = strTemp;
            document.getElementById('natNumberField').innerHTML = strTemp;
            document.getElementById('nameField').innerHTML = strTemp;
            document.getElementById('firstNamesField').innerHTML = strTemp;
            document.getElementById('natField').innerHTML = strTemp;
            document.getElementById('birthLocField').innerHTML = strTemp;
            document.getElementById('birthDateField').innerHTML = strTemp;
            document.getElementById('sexField').innerHTML = strTemp;
            document.getElementById('streetField').innerHTML = strTemp;
            document.getElementById('municField').innerHTML = strTemp;
            document.getElementById('countryField').innerHTML = strTemp;
            document.getElementById('StatusField').innerHTML = strTemp;
        }
     
        function ReadCard()
        {
          var retval;
          EmptyScreen();
          document.getElementById('StatusField').innerHTML = "Reading Card, please wait...";
          retval = document.BEIDApplet.InitLib(null);
          if(retval == 0)
          {
            document.getElementById('StatusField').innerHTML = "Reading Identity, please wait...";
            getIDData();
            document.getElementById('StatusField').innerHTML = "Reading Address, please wait...";
            getAddressData();
            document.getElementById('StatusField').innerHTML = "Reading Picture, please wait...";
            document.BEIDApplet.GetPicture();
    	  document.BEIDApplet.ExitLib();
            document.getElementById('StatusField').innerHTML = "Done";
          }
    	else
          {
            document.getElementById('StatusField').innerHTML = "Error Reading Card";
          }
        }
     
    </script>
     
    <style>
    .fontName {font-family:Arial Unicode MS, Verdana, Arial, Helvetica, sans-serif;}
    .backgroundPanel {background-color:#F7F7F7;}
    .backgroundRoundedPanel {background-color:#CED3DE;}
    .labelText {font-size:12px; color:#4A5563;}
    .dataText {font-size:12px; color:#000000;}
    .tableDarkShadow {background-color:#87CFA3;}
    </style>
     
    </head>
     
    <body topmargin=0>
     
    <form name=actionform>
          <table class="fontName" width="100%" border="0" cellspacing="0" cellpadding="0">
            <tr>
              <td>
                <table class="fontName" width="100%" border="0" cellspacing="0" cellpadding="0">
                  <tr class="tableDarkShadow">
                  <td class="labelText" valign="top" align="center">&nbsp;IDENTITY&nbsp;</td>
                  </tr>
                  </table>
                </td>
              </tr>
    <tr>
    <td valign="top">
    <applet
      codebase = "."
      archive  = "beidlib.jar"
      code     = "be.belgium.eid.BEID_Applet.class"
      name     = "BEIDApplet"
      width    = "140"
      height   = "200"
      hspace   = "0"
      vspace   = "0"
      align    = "middle"
    >
    <param name="Reader" value="">
    <param name="OCSP" value="-1">
    <param name="CRL" value="-1">
    <param name="DisableWarning" value="true">
    </applet>
    </td>
    </tr>
    <tr>
    <td>&nbsp;</td>
    </tr>
    <tr>
              <td valign="top">
                <table width="100%" border="0" cellspacing="0" cellpadding="0">                  
                        <tr class="backgroundPanel">
                          <td class="labelText" align="right" width="150" nowrap>&nbsp;Card Number:&nbsp;</td>
                          <td class="dataText" id="cardNumberField" align="left" nowrap>&nbsp;</td>
                        </tr>
                        <tr class="backgroundRoundedPanel" height="4"><td colspan="2"></tr>
                        <tr class="backgroundRoundedPanel">
                          <td class="labelText" align="right" width="150" nowrap>&nbsp;Chip Number:&nbsp;</td>
                          <td class="dataText" align="left" id="chipNumberField" nowrap>&nbsp;</td>
                        </tr>
                        <tr class="backgroundPanel" height="4"><td colspan="2"></tr>
                        <tr class="backgroundPanel">
                          <td class="labelText" align="right" width="150" nowrap>&nbsp;Validity From:&nbsp;</td>
                          <td class="dataText" id="valBeginField" align="left" nowrap>&nbsp;</td>
                        </tr>
                        <tr class="backgroundRoundedPanel" height="4"><td colspan="2"></tr>
                        <tr class="backgroundRoundedPanel">
                          <td class="labelText" align="right" width="150" nowrap>&nbsp;Validity Until:&nbsp;</td>
                          <td class="dataText" id="valEndField" align="left" nowrap>&nbsp;</td>
                        </tr>
                        <tr class="backgroundPanel" height="4"><td colspan="2"></tr>
                        <tr class="backgroundPanel">
                          <td class="labelText" align="right" width="150" nowrap>&nbsp;Issuing Municipality:&nbsp;</td>
                          <td class="dataText" id="issMunicField" align="left" nowrap>&nbsp;</td>
                        </tr>
                        <tr class="backgroundRoundedPanel" height="4"><td colspan="2"></tr>
                        <tr class="backgroundRoundedPanel">
                          <td class="labelText" align="right" width="150" nowrap>&nbsp;National Number:&nbsp;</td>
                          <td class="dataText" align="left" id="natNumberField" nowrap>&nbsp;</td>
                        </tr>
                        <tr class="backgroundPanel" height="4"><td colspan="2"></tr>
                        <tr class="backgroundPanel">
                          <td class="labelText" align="right" width="150" nowrap>&nbsp;Name:&nbsp;</td>
                          <td class="dataText" id="nameField" align="left" nowrap>&nbsp;</td>
                        </tr>
                        <tr class="backgroundRoundedPanel" height="4"><td colspan="2"></tr>
                        <tr class="backgroundRoundedPanel">
                          <td class="labelText" align="right" width="150" nowrap>&nbsp;First Names:&nbsp;</td>
                          <td class="dataText" id="firstNamesField" align="left">&nbsp;</td>
                        </tr>
                        <tr class="backgroundPanel" height="4"><td colspan="2"></tr>
                        <tr class="backgroundPanel">
                          <td class="labelText" align="right" width="150" nowrap>&nbsp;Nationality:&nbsp;</td>
                          <td class="dataText" id="natField" align="left" nowrap>&nbsp;</td>
                        </tr>
                        <tr class="backgroundRoundedPanel" height="4"><td colspan="2"></tr>
                        <tr class="backgroundRoundedPanel">
                          <td class="labelText" align="right" width="150" nowrap>&nbsp;Birth Location:&nbsp;</td>
                          <td class="dataText" align="left" id="birthLocField" nowrap>&nbsp;</td>
                        </tr>
                        <tr class="backgroundPanel" height="4"><td colspan="2"></tr>
                        <tr class="backgroundPanel">
                          <td class="labelText" align="right" width="150" nowrap>&nbsp;Birth Date:&nbsp;</td>
                          <td class="dataText" id="birthDateField" align="left" nowrap>&nbsp;</td>
                        </tr>
                        <tr class="backgroundRoundedPanel" height="4"><td colspan="2"></tr>
                        <tr class="backgroundRoundedPanel">
                          <td class="labelText" align="right" width="150" nowrap>&nbsp;Sex:&nbsp;</td>
                          <td class="dataText" id="sexField" align="left" nowrap>&nbsp;</td>
                        </tr>                    
                </table>
              </td>
            </tr>
            <tr>
              <td>
                <table class="fontName" width="100%" border="0" cellspacing="0" cellpadding="0">
                  <tr height="10"><td>&nbsp;</td></tr>
                  <tr class="tableDarkShadow">
                  <td class="labelText" valign="top" align="center">&nbsp;ADDRESS&nbsp;</td>
                  </tr>
                  </table>
                </td>
              </tr>
            <tr>
              <td valign="top">
                <table width="100%" border="0" cellspacing="0" cellpadding="0">
                        <tr class="backgroundPanel">
                          <td class="labelText" align="right" width="150" nowrap>&nbsp;Street:&nbsp;</td>
                          <td class="dataText" id="streetField" align="left" nowrap>&nbsp;</td>
                        </tr>
                        <tr class="backgroundRoundedPanel" height="4"><td colspan="2"></tr>
                        <tr class="backgroundRoundedPanel">
                          <td class="labelText" align="right" width="150" nowrap>&nbsp;Municipality:&nbsp;</td>
                          <td class="dataText" align="left" id="municField">&nbsp;</td>
                        </tr>
                        <tr class="backgroundPanel" height="4"><td colspan="2"></tr>
                        <tr class="backgroundPanel">
                          <td class="labelText" align="right" width="150" nowrap>&nbsp;Country:&nbsp;</td>
                          <td class="dataText" align="left" id="countryField">&nbsp;</td>
                        </tr>
                        <tr height="5"><td colspan="2"></tr>
                </table>
              </td>
            </tr>
            <tr>
              <td> <input type="button" name="IDButton" onclick="javascript:ReadCard()" value="Read Card "title="Read Card"/> </td>
            </tr>
            <tr height="5"><td colspan="2"></tr>
            <tr>
              <td class="labelText" ID="StatusField"/></td>
            </tr>
          </table>
        </form>
     
    </body>
    </html>

  18. #18
    Modérateur
    Avatar de sabotage
    Homme Profil pro
    Inscrit en
    Juillet 2005
    Messages
    29 208
    Détails du profil
    Informations personnelles :
    Sexe : Homme

    Informations forums :
    Inscription : Juillet 2005
    Messages : 29 208
    Par défaut
    Tu as déja un formulaire dans ce code.
    Il lui manque juste un bouton submit, et l'indication d'une methode et d'une action dans le <form>
    N'oubliez pas de consulter les FAQ PHP et les cours et tutoriels PHP

  19. #19
    Membre averti
    Profil pro
    Inscrit en
    Juillet 2010
    Messages
    15
    Détails du profil
    Informations personnelles :
    Localisation : Belgique

    Informations forums :
    Inscription : Juillet 2010
    Messages : 15
    Par défaut
    oui je sais mais même en les ajoutant je n'arrive pas à récuperer les données!
    Code : Sélectionner tout - Visualiser dans une fenêtre à part
    1
    2
    3
    4
    5
    6
    7
    8
    9
    10
    11
    12
    13
    14
    15
    16
    17
    18
    19
    20
    21
    22
    23
    24
    25
    26
    27
    28
    29
    30
    31
    32
    33
    34
    35
    36
    37
    38
    39
    40
    41
    42
    43
    44
    45
    46
    47
    48
    49
    50
    51
    52
    53
    54
    55
    56
    57
    58
    59
    60
    61
    62
    63
    64
    65
    66
    67
    68
    69
    70
    71
    72
    73
    74
    75
    76
    77
    78
    79
    80
    81
    82
    83
    84
    85
    86
    87
    88
    89
    90
    91
    92
    93
    94
    95
    96
    97
    98
    99
    100
    101
    102
    103
    104
    105
    106
    107
    108
    109
    110
    111
    112
    113
    114
    115
    116
    117
    118
    119
    120
    121
    122
    123
    124
    125
    126
    127
    128
    129
    130
    131
    132
    133
    134
    135
    136
    137
    138
    139
    140
    141
    142
    143
    144
    145
    146
    147
    148
    149
    150
    151
    152
    153
    154
    155
    156
    157
    158
    159
    160
    161
    162
    163
    164
    165
    166
    167
    168
    169
    170
    171
    172
    173
    174
    175
    176
    177
    178
    179
    180
    181
    182
    183
    184
    185
    186
    187
    188
    189
    190
    191
    192
    193
    194
    195
    196
    197
    198
    199
    200
    201
    202
    203
    204
    205
    206
    207
    208
    209
    210
    211
    212
    213
    214
    215
    216
    217
    218
    219
    220
    221
    222
    223
    224
    225
    226
    227
    228
    229
    230
    231
    232
    233
    234
    235
    236
    237
    238
    239
    240
    241
    242
    243
    244
    245
    246
    247
    248
    249
    250
    251
    252
    253
    254
    255
    256
    257
    258
    259
    260
    261
    262
    263
    264
    265
     
    html>
    <head>
    <meta http-equiv="Content-Type" content="text/html; charset=utf-8">
     
    <title>
    Belgian EID Card
    </title>
     
    <script language="javascript">
        function getIDData()
        {
            var strTemp;
            var strTemp2;
            var strTemp3;
     
            strTemp = document.BEIDApplet.getCardNumber() + "&nbsp;";
            document.getElementById('cardNumberField').innerHTML = strTemp;
            strTemp = document.BEIDApplet.getChipNumber() + "&nbsp;";
            document.getElementById('chipNumberField').innerHTML = strTemp;
            strTemp = document.BEIDApplet.getValidityDateBegin() + "&nbsp;";
            document.getElementById('valBeginField').innerHTML = strTemp;
            strTemp = document.BEIDApplet.getValidityDateEnd() + "&nbsp;";
            document.getElementById('valEndField').innerHTML = strTemp;
            strTemp = document.BEIDApplet.getIssMunicipality() + "&nbsp;";
            document.getElementById('issMunicField').innerHTML = strTemp;
            strTemp = document.BEIDApplet.getNationalNumber() + "&nbsp;";
            document.getElementById('natNumberField').innerHTML = strTemp;
            strTemp = document.BEIDApplet.getName() + "&nbsp;";
            document.getElementById('nameField').innerHTML = strTemp;
            strTemp = document.BEIDApplet.getFirstName1();
            strTemp2 = document.BEIDApplet.getFirstName2();
            strTemp3 = document.BEIDApplet.getFirstName3();
            document.getElementById('firstNamesField').innerHTML = strTemp + " " + strTemp2 + " " + strTemp3 + "&nbsp;";
            strTemp = document.BEIDApplet.getNationality() + "&nbsp;";
            document.getElementById('natField').innerHTML = strTemp;
            strTemp = document.BEIDApplet.getBirthLocation() + "&nbsp;";
            document.getElementById('birthLocField').innerHTML = strTemp;
            strTemp = document.BEIDApplet.getBirthDate() + "&nbsp;";
            document.getElementById('birthDateField').innerHTML = strTemp;
            strTemp = document.BEIDApplet.getSex() + "&nbsp;";
            document.getElementById('sexField').innerHTML = strTemp;
            document.BEIDApplet.getNobleCondition();
            document.BEIDApplet.getWhiteCane();
            document.BEIDApplet.getYellowCane();
            document.BEIDApplet.getExtendedMinority();
        }
     
        function getAddressData()
        {
    	  var strTemp;
            var strTemp2;
            var strTemp3;
            strTemp = document.BEIDApplet.getStreet();
            strTemp2 = document.BEIDApplet.getStreetNumber();
            strTemp3 = document.BEIDApplet.getBoxNumber();
            document.getElementById('streetField').innerHTML = strTemp + " " + strTemp2 + " " + strTemp3 + "&nbsp;";
            strTemp = document.BEIDApplet.getZip();
            strTemp2 = document.BEIDApplet.getMunicipality();
            document.getElementById('municField').innerHTML = strTemp + " " + strTemp2 + "&nbsp;";
            strTemp = document.BEIDApplet.getCountry();
            document.getElementById('countryField').innerHTML = strTemp + "&nbsp;";
        }
        function EmptyScreen()
        {
            var strTemp = "&nbsp;";
            document.getElementById('cardNumberField').innerHTML = strTemp;
            document.getElementById('chipNumberField').innerHTML = strTemp;
            document.getElementById('valBeginField').innerHTML = strTemp;
            document.getElementById('valEndField').innerHTML = strTemp;
            document.getElementById('issMunicField').innerHTML = strTemp;
            document.getElementById('natNumberField').innerHTML = strTemp;
            document.getElementById('nameField').innerHTML = strTemp;
            document.getElementById('firstNamesField').innerHTML = strTemp;
            document.getElementById('natField').innerHTML = strTemp;
            document.getElementById('birthLocField').innerHTML = strTemp;
            document.getElementById('birthDateField').innerHTML = strTemp;
            document.getElementById('sexField').innerHTML = strTemp;
            document.getElementById('streetField').innerHTML = strTemp;
            document.getElementById('municField').innerHTML = strTemp;
            document.getElementById('countryField').innerHTML = strTemp;
            document.getElementById('StatusField').innerHTML = strTemp;
        }
     
        function ReadCard()
        {
          var retval;
          EmptyScreen();
          document.getElementById('StatusField').innerHTML = "Reading Card, please wait...";
          retval = document.BEIDApplet.InitLib(null);
          if(retval == 0)
          {
            document.getElementById('StatusField').innerHTML = "Reading Identity, please wait...";
            getIDData();
            document.getElementById('StatusField').innerHTML = "Reading Address, please wait...";
            getAddressData();
            document.getElementById('StatusField').innerHTML = "Reading Picture, please wait...";
            document.BEIDApplet.GetPicture();
    	  document.BEIDApplet.ExitLib();
            document.getElementById('StatusField').innerHTML = "Done";
          }
    	else
          {
            document.getElementById('StatusField').innerHTML = "Error Reading Card";
          }
        }
     
    </script>
     
    <style>
    .fontName {font-family:Arial Unicode MS, Verdana, Arial, Helvetica, sans-serif;}
    .backgroundPanel {background-color:#F7F7F7;}
    .backgroundRoundedPanel {background-color:#CED3DE;}
    .labelText {font-size:12px; color:#4A5563;}
    .dataText {font-size:12px; color:#000000;}
    .tableDarkShadow {background-color:#87CFA3;}
    </style>
     
    </head>
     
    <body topmargin=0>
     
    <FORM action="envoi.php" method="post">
          <table class="fontName" width="100%" border="0" cellspacing="0" cellpadding="0">
            <tr>
              <td>
                <table class="fontName" width="100%" border="0" cellspacing="0" cellpadding="0">
                  <tr class="tableDarkShadow">
                  <td class="labelText" valign="top" align="center">&nbsp;IDENTITY&nbsp;</td>
                  </tr>
                  </table>
                </td>
              </tr>
    <tr>
    <td valign="top">
    <applet
      codebase = "."
      archive  = "beidlib.jar"
      code     = "be.belgium.eid.BEID_Applet.class"
      name     = "BEIDApplet"
      width    = "140"
      height   = "200"
      hspace   = "0"
      vspace   = "0"
      align    = "middle"
    >
    <param name="Reader" value="">
    <param name="OCSP" value="-1">
    <param name="CRL" value="-1">
    <param name="DisableWarning" value="true">
    </applet>
    </td>
    </tr>
    <tr>
    <td>&nbsp;</td>
    </tr>
    <tr>
              <td valign="top">
                <table width="100%" border="0" cellspacing="0" cellpadding="0">                  
                        <tr class="backgroundPanel">
                          <td class="labelText" align="right" width="150" nowrap>&nbsp;Card Number:&nbsp;</td>
                          <td class="dataText" id="cardNumberField" align="left" nowrap>&nbsp;</td>
                        </tr>
                        <tr class="backgroundRoundedPanel" height="4"><td colspan="2"></tr>
                        <tr class="backgroundRoundedPanel">
                          <td class="labelText" align="right" width="150" nowrap>&nbsp;Chip Number:&nbsp;</td>
                          <td class="dataText" align="left" id="chipNumberField" nowrap>&nbsp;</td>
                        </tr>
                        <tr class="backgroundPanel" height="4"><td colspan="2"></tr>
                        <tr class="backgroundPanel">
                          <td class="labelText" align="right" width="150" nowrap>&nbsp;Validity From:&nbsp;</td>
                          <td class="dataText" id="valBeginField" align="left" nowrap>&nbsp;</td>
                        </tr>
                        <tr class="backgroundRoundedPanel" height="4"><td colspan="2"></tr>
                        <tr class="backgroundRoundedPanel">
                          <td class="labelText" align="right" width="150" nowrap>&nbsp;Validity Until:&nbsp;</td>
                          <td class="dataText" id="valEndField" align="left" nowrap>&nbsp;</td>
                        </tr>
                        <tr class="backgroundPanel" height="4"><td colspan="2"></tr>
                        <tr class="backgroundPanel">
                          <td class="labelText" align="right" width="150" nowrap>&nbsp;Issuing Municipality:&nbsp;</td>
                          <td class="dataText" id="issMunicField" align="left" nowrap>&nbsp;</td>
                        </tr>
                        <tr class="backgroundRoundedPanel" height="4"><td colspan="2"></tr>
                        <tr class="backgroundRoundedPanel">
                          <td class="labelText" align="right" width="150" nowrap>&nbsp;National Number:&nbsp;</td>
                          <td class="dataText" align="left" id="natNumberField" nowrap>&nbsp;</td>
                        </tr>
                        <tr class="backgroundPanel" height="4"><td colspan="2"></tr>
                        <tr class="backgroundPanel">
                          <td class="labelText" align="right" width="150" nowrap>&nbsp;Name:&nbsp;</td>
                          <td class="dataText" id="nameField" align="left" nowrap>&nbsp;</td>
                        </tr>
                        <tr class="backgroundRoundedPanel" height="4"><td colspan="2"></tr>
                        <tr class="backgroundRoundedPanel">
                          <td class="labelText" align="right" width="150" nowrap>&nbsp;First Names:&nbsp;</td>
                          <td class="dataText" id="firstNamesField" align="left">&nbsp;</td>
                        </tr>
                        <tr class="backgroundPanel" height="4"><td colspan="2"></tr>
                        <tr class="backgroundPanel">
                          <td class="labelText" align="right" width="150" nowrap>&nbsp;Nationality:&nbsp;</td>
                          <td class="dataText" id="natField" align="left" nowrap>&nbsp;</td>
                        </tr>
                        <tr class="backgroundRoundedPanel" height="4"><td colspan="2"></tr>
                        <tr class="backgroundRoundedPanel">
                          <td class="labelText" align="right" width="150" nowrap>&nbsp;Birth Location:&nbsp;</td>
                          <td class="dataText" align="left" id="birthLocField" nowrap>&nbsp;</td>
                        </tr>
                        <tr class="backgroundPanel" height="4"><td colspan="2"></tr>
                        <tr class="backgroundPanel">
                          <td class="labelText" align="right" width="150" nowrap>&nbsp;Birth Date:&nbsp;</td>
                          <td class="dataText" id="birthDateField" align="left" nowrap>&nbsp;</td>
                        </tr>
                        <tr class="backgroundRoundedPanel" height="4"><td colspan="2"></tr>
                        <tr class="backgroundRoundedPanel">
                          <td class="labelText" align="right" width="150" nowrap>&nbsp;Sex:&nbsp;</td>
                          <td class="dataText" id="sexField" align="left" nowrap>&nbsp;</td>
                        </tr>                    
                </table>
              </td>
            </tr>
            <tr>
              <td>
                <table class="fontName" width="100%" border="0" cellspacing="0" cellpadding="0">
                  <tr height="10"><td>&nbsp;</td></tr>
                  <tr class="tableDarkShadow">
                  <td class="labelText" valign="top" align="center">&nbsp;ADDRESS&nbsp;</td>
                  </tr>
                  </table>
                </td>
              </tr>
            <tr>
              <td valign="top">
                <table width="100%" border="0" cellspacing="0" cellpadding="0">
                        <tr class="backgroundPanel">
                          <td class="labelText" align="right" width="150" nowrap>&nbsp;Street:&nbsp;</td>
                          <td class="dataText" id="streetField" align="left" nowrap>&nbsp;</td>
                        </tr>
                        <tr class="backgroundRoundedPanel" height="4"><td colspan="2"></tr>
                        <tr class="backgroundRoundedPanel">
                          <td class="labelText" align="right" width="150" nowrap>&nbsp;Municipality:&nbsp;</td>
                          <td class="dataText" align="left" id="municField">&nbsp;</td>
                        </tr>
                        <tr class="backgroundPanel" height="4"><td colspan="2"></tr>
                        <tr class="backgroundPanel">
                          <td class="labelText" align="right" width="150" nowrap>&nbsp;Country:&nbsp;</td>
                          <td class="dataText" align="left" id="countryField">&nbsp;</td>
                        </tr>
                        <tr height="5"><td colspan="2"></tr>
                </table>
              </td>
            </tr>
            <tr>
              <td> <input type="button" name="IDButton" onclick="javascript:ReadCard()" value="Read Card "title="Read Card"/> </td>
            </tr>
            <tr height="5"><td colspan="2"></tr>
            <tr>
              <td class="labelText" ID="StatusField"/></td>
            </tr>
          </table>
    	  <INPUT type="submit" value="Save"> 
        </form>
     
    </body>
    </html>

  20. #20
    Membre averti
    Profil pro
    Inscrit en
    Juillet 2010
    Messages
    15
    Détails du profil
    Informations personnelles :
    Localisation : Belgique

    Informations forums :
    Inscription : Juillet 2010
    Messages : 15
    Par défaut
    pourrais tu me montrer dans mon code comment y parvenir ?

Discussions similaires

  1. [Librairie] [TELNET] Faire du telnet en PHP sur un serveur distant
    Par kaboume dans le forum Bibliothèques et frameworks
    Réponses: 10
    Dernier message: 10/06/2010, 15h24
  2. Faire tourner du code PHP sur un CD Rom
    Par Furius dans le forum Langage
    Réponses: 8
    Dernier message: 22/11/2005, 13h16
  3. Faire cohabiter ASP et PHP sur une même DB
    Par freud dans le forum Général Conception Web
    Réponses: 12
    Dernier message: 12/10/2005, 18h42
  4. [INDY] comment faire un 'POST' avec idHTTP??
    Par gamez dans le forum Composants VCL
    Réponses: 5
    Dernier message: 17/05/2004, 20h02
  5. Coment faire du post-processing avec Dx9 ?
    Par rolkA dans le forum DirectX
    Réponses: 23
    Dernier message: 24/11/2003, 22h15

Partager

Partager
  • Envoyer la discussion sur Viadeo
  • Envoyer la discussion sur Twitter
  • Envoyer la discussion sur Google
  • Envoyer la discussion sur Facebook
  • Envoyer la discussion sur Digg
  • Envoyer la discussion sur Delicious
  • Envoyer la discussion sur MySpace
  • Envoyer la discussion sur Yahoo