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

Langage PHP Discussion :

Intégration Php dans HTML


Sujet :

Langage PHP

  1. #1
    Membre du Club
    Femme Profil pro
    Étudiant
    Inscrit en
    Janvier 2012
    Messages
    56
    Détails du profil
    Informations personnelles :
    Sexe : Femme
    Âge : 33
    Localisation : Algérie

    Informations professionnelles :
    Activité : Étudiant
    Secteur : High Tech - Matériel informatique

    Informations forums :
    Inscription : Janvier 2012
    Messages : 56
    Points : 42
    Points
    42
    Par défaut Intégration Php dans HTML
    Salut,

    Bon j'ai créé plusieurs pages en Php, qui contiennent les résultat de plusieurs calculs, chaque page en fait une partie et appelle une autre ainsi de suite.

    Après avoir fini avec ces calculs, je voulais faire une petite jolie interface en HTML (en se servant de dreamweaver, donc j'ai pas programmé en HTML) et intégrer la première page .php dans le code HTML (la page qui d déclenche les calculs). Selon mes modestes connaissances, il n'existe aucune règle à suivre pour mettre du Php dans HTML, donc je l'ai mis avant </body>.

    Mon problème c'est qu'il m'affiche une portion du code et n'exécute rien de ce qui est sensé être exécuté!!

    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
    266
    267
    268
    269
    270
    271
    272
    273
    274
    275
    276
    277
    278
    279
    280
    281
    282
    283
    284
    285
    286
    287
    288
    289
    290
    291
    292
    293
    294
    295
    296
    297
    298
    299
    300
    <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
    <html xmlns="http://www.w3.org/1999/xhtml">
    <head>
    <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
    <title>Document sans nom</title>
    <style type="text/css">
    #Layer3 {
    	position: absolute;
    	left: 0px;
    	top: -1px;
    	width: 1113px;
    	height: 694px;
    	z-index: 3;
    	background-color: #000000;
    }
    #Layer5 {
    	position: absolute;
    	left: 15px;
    	top: 15px;
    	width: 825px;
    	height: 478px;
    	z-index: 5;
    	background-color: #000000;
    	color: #C0F;
    }
    #Layer {
    	position: absolute;
    	left: 332px;
    	top: 406px;
    	width: 226px;
    	height: 42px;
    	z-index: 5;
    }
    #Layer2 {
    	position: absolute;
    	left: 247px;
    	top: 131px;
    	width: 265px;
    	height: 287px;
    	z-index: 5;
    }
    #Layer4 {
    	position: absolute;
    	left: 178px;
    	top: 27px;
    	width: 685px;
    	height: 64px;
    	z-index: 5;
    }
    #Layer6 {
    	position: absolute;
    	left: 657px;
    	top: 262px;
    	width: 238px;
    	height: 276px;
    	z-index: 5;
    }
    #Layer7 {
    	position: absolute;
    	left: 72px;
    	top: 123px;
    	width: 131px;
    	height: 58px;
    	z-index: 5;
    }
    .Style12 {
    	font-size: 14px;
    	font-weight: bold;
    	font-style: italic;
    	color: #000;
    }
    </style>
    <style type="text/css" media="color-index">
    @import url("../Documents/Site sans nom 2/CSS/colors5.css");
    </style>
    <style type="text/css" media="color">
    @import url("../Documents/Site sans nom 2/CSS/colors3.css");
    </style>
    <link href="../Documents/Site sans nom 2/CSS/Level3_1.css" rel="stylesheet" type="text/css" />
    <style type="text/css">
    #Layer8 {
    	position: absolute;
    	left: 166px;
    	top: 27px;
    	width: 517px;
    	height: 56px;
    	z-index: 5;
    	color: #F0F;
    }
    #Layer9 {
    	position: absolute;
    	left: 349px;
    	top: 5px;
    	width: 141px;
    	height: 52px;
    	z-index: 5;
    }
    #Layer10 {
    	position: absolute;
    	left: 62px;
    	top: 233px;
    	width: 137px;
    	height: 51px;
    	z-index: 5;
    	color: #FFF;
    }
    #Layer11 {
    	position: absolute;
    	left: 69px;
    	top: 159px;
    	width: 151px;
    	height: 55px;
    	z-index: 5;
    	color: #FFF;
    }
    #Layer12 {
    	position: absolute;
    	left: 67px;
    	top: 196px;
    	width: 115px;
    	height: 52px;
    	z-index: 5;
    }
    #Layer13 {
    	position: absolute;
    	left: 99px;
    	top: 125px;
    	width: 859px;
    	height: 511px;
    	z-index: 5;
    	background-color: #FF00FF;
    }
    #Layer14 {
    	position: absolute;
    	left: 66px;
    	top: 271px;
    	width: 100px;
    	height: 49px;
    	z-index: 5;
    }
    #Layer15 {	position: absolute;
    	left: 409px;
    	top: 315px;
    	width: 125px;
    	height: 55px;
    	z-index: 5;
    }
    #Layer16 {	position: absolute;
    	left: 409px;
    	top: 315px;
    	width: 125px;
    	height: 55px;
    	z-index: 5;
    }
    #Layer17 {	position: absolute;
    	left: 409px;
    	top: 315px;
    	width: 125px;
    	height: 55px;
    	z-index: 5;
    }
    #Layer18 {	position: absolute;
    	left: 409px;
    	top: 315px;
    	width: 125px;
    	height: 55px;
    	z-index: 5;
    }
    #Layer19 {	position: absolute;
    	left: 349px;
    	top: 5px;
    	width: 141px;
    	height: 52px;
    	z-index: 5;
    }
    .Style121 {font-size: 14px; font-weight: bold; font-style: italic; }
    #Layer20 {	position: absolute;
    	left: 155px;
    	top: 24px;
    	width: 115px;
    	height: 105px;
    	z-index: 5;
    }
    .Style37 {font-family: "Comic Sans MS"}
    #Layer32 {
    	position: absolute;
    	left: 96px;
    	top: 512px;
    	width: 701px;
    	height: 45px;
    	z-index: 28;
    }
    #Layer21 {	position: absolute;
    	left: 66px;
    	top: 238px;
    	width: 115px;
    	height: 52px;
    	z-index: 5;
    }
    #Layer3 #Layer13 #Layer5 #Layer7 h2 {
    	color: #F0F;
    }
    #Layer3 #Layer13 #Layer5 #Layer14 h2 strong {
    	color: #FOF;
    }
    #Layer3 #Layer13 #Layer5 #Layer12 h2 {
    	color: #F0F;
    }
    #Layer3 #Layer13 #Layer5 #Layer11 h2 {
    	color: #F0F;
    }
    #Layer3 #Layer13 #Layer5 #Layer10 h2 {
    	color: #F0F;
    }
    #Layer3 #Layer13 #Layer5 #Layer14 h2 strong {
    	color: #FOF;
    }
    #Layer3 #Layer13 #Layer5 #Layer8 h2 {
    	color: #FOF;
    	font-size: 18px;
    }
    #Layer3 #Layer13 #Layer5 #Layer14 h2 strong {
    	color: #F0F;
    }
    </style>
    </head>
     
    <body>
    <div id="Layer3">
      <div class="Style12" id="Layer13">
        <div id="Layer5">
          <div id="Layer">
          <form action = "test interface ness.html" method="post">
            <input name="Submit2" type="submit" class="Style12" value="retour" />
          </div>
     
          <div class="Style12" id="Layer8">
            <h2>Résultat : </h2>
          </div>
        </div>
      </div>
      <div class="Style12" id="Layer4">
        <h2><img src="kkkk.gif" width="676" height="49" /></h2>
      </div>
      <div class="Style12" id="Layer6">
        <h2><img src="bloggif_511eb64b3cc86.gif" width="195" height="196" /></h2>
      </div>
      <div class="Style12" id="Layer8">
            <h2></h2>
     
      </div>
     
    </div>
     
    <?php
      $temperature = $_POST['temperature'];
      $etat_peau = $_POST['choix'];
      $vomissement = $_POST['vomissement'];
      $cephale = $_POST['cephale'];
      $pouls = $_POST['pouls'];
     
     
    if  (
         empty($_POST['temperature'])
         or empty($_POST['choix'])
         or empty($_POST['cephale'])
         or empty($_POST['vomissement'])
         or empty($_POST['pouls'])
        )
    {
         echo 'Vous avez envoyé un formulaire vide, veuillez remplir à nouveau svp';
    }
    elseif (
             $temperature == 37
             AND $etat_peau == 'normale'
             AND $vomissement == 'non'
             AND $cephale == 'non'
             AND $pouls == 90
    	   ) 
    {
         echo 'Votre enfant est en bonne santé';
    }		 		 
    else { 
         include("connexion.php");
     
         $sql="INSERT INTO `nouveau_cas` (`temperature`,`etat_peau`,`vomissement`,`cephale`,`pouls`)
                VALUES ('$temperature','$etat_peau','$cephale','$vomissement','$pouls')";
         $requette1=mysql_query($sql) or die('Erreur SQL !'.$sql1.'<br />'.mysql_error());
     
         echo 'insertion du nouveau cas réussite';
        echo '<br>';
        echo "etat inséré : ".$etat_peau; 
        echo '<br>';
        include("recuperation.php");
     }
    ?>
     
    </body>
     
    </html>
    Voici ce qui est affiché:
    Code : Sélectionner tout - Visualiser dans une fenêtre à part
    1
    2
    3
    '.mysql_error()); // echo 'insertion du nouveau cas réussite'; // echo '
    '; //echo "etat inséré : ".$etat_peau; // echo '
    '; //include("recuperation.php"); } ?>
    Merci d'avance

  2. #2
    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
    Points : 44 155
    Points
    44 155
    Par défaut
    Ton fichier a bien l'extension .php ?
    N'oubliez pas de consulter les FAQ PHP et les cours et tutoriels PHP

  3. #3
    Membre du Club
    Femme Profil pro
    Étudiant
    Inscrit en
    Janvier 2012
    Messages
    56
    Détails du profil
    Informations personnelles :
    Sexe : Femme
    Âge : 33
    Localisation : Algérie

    Informations professionnelles :
    Activité : Étudiant
    Secteur : High Tech - Matériel informatique

    Informations forums :
    Inscription : Janvier 2012
    Messages : 56
    Points : 42
    Points
    42
    Par défaut
    Non, quel fichier d'abord?

    Le code Php je l'ai intégré directement dans le code HTML!

  4. #4
    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
    Points : 44 155
    Points
    44 155
    Par défaut
    Le fichier qui contient le code PHP doit avoir l'extension .php
    N'oubliez pas de consulter les FAQ PHP et les cours et tutoriels PHP

  5. #5
    Membre du Club
    Femme Profil pro
    Étudiant
    Inscrit en
    Janvier 2012
    Messages
    56
    Détails du profil
    Informations personnelles :
    Sexe : Femme
    Âge : 33
    Localisation : Algérie

    Informations professionnelles :
    Activité : Étudiant
    Secteur : High Tech - Matériel informatique

    Informations forums :
    Inscription : Janvier 2012
    Messages : 56
    Points : 42
    Points
    42
    Par défaut
    Non je n'ai aucun fichier qui contient l'extension .php, puisque comme j'ai dit, j'ai mis directement le code PHP dans le code HTML! Comme tu peux voir dans le code posté, le code php lui meme appelle une autre page .php!

  6. #6
    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
    Points : 44 155
    Points
    44 155
    Par défaut
    Ce n'est pas une question que je posais, c'est que tu dois faire
    Le fichier qui contient le code PHP doit avoir l'extension .php
    N'oubliez pas de consulter les FAQ PHP et les cours et tutoriels PHP

  7. #7
    Membre du Club
    Femme Profil pro
    Étudiant
    Inscrit en
    Janvier 2012
    Messages
    56
    Détails du profil
    Informations personnelles :
    Sexe : Femme
    Âge : 33
    Localisation : Algérie

    Informations professionnelles :
    Activité : Étudiant
    Secteur : High Tech - Matériel informatique

    Informations forums :
    Inscription : Janvier 2012
    Messages : 56
    Points : 42
    Points
    42
    Par défaut
    Oui tout mes fichiers qui contiennent du PHP ont l'extension .php!
    Mais tu n'as pas répondu à ma question, puisque mon code ne contient pas de fichier php, il contient exactement le code entier??

  8. #8
    Membre éprouvé Avatar de tdutrion
    Homme Profil pro
    Architecte technique
    Inscrit en
    Février 2009
    Messages
    561
    Détails du profil
    Informations personnelles :
    Sexe : Homme
    Âge : 35
    Localisation : France, Côte d'Or (Bourgogne)

    Informations professionnelles :
    Activité : Architecte technique
    Secteur : High Tech - Éditeur de logiciels

    Informations forums :
    Inscription : Février 2009
    Messages : 561
    Points : 1 105
    Points
    1 105
    Par défaut
    Bonjour,

    Il faut vraiment que tu lises le tutoriel PHP (celui-ci ou un autre).

    On ne peut pas répondre à tes questions (qui par ailleurs ne veulent rien dire).

    Tu peux aussi poster ton code en n'oubliant pas de préciser le nom des fichiers...

Discussions similaires

  1. Intégration swf dans HTML
    Par rems033 dans le forum Intégration
    Réponses: 1
    Dernier message: 11/09/2008, 09h40
  2. [HTML] Intégration flash dans html et importations de fichier
    Par ispeace dans le forum Balisage (X)HTML et validation W3C
    Réponses: 1
    Dernier message: 09/08/2007, 21h48
  3. intégration XML dans HTML
    Par jem27 dans le forum XML/XSL et SOAP
    Réponses: 5
    Dernier message: 15/06/2006, 15h58
  4. HTML dans PHP, PHP dans HTML...
    Par jeremy_chauvel dans le forum Langage
    Réponses: 3
    Dernier message: 24/04/2006, 20h28
  5. [FLASH 8] Intégration Php dans une anim Flash
    Par MrPink dans le forum Flash
    Réponses: 1
    Dernier message: 01/02/2006, 22h26

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