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 :

[PHP-JS] Message d'erreur concernant la syntaxe à corriger


Sujet :

Langage PHP

  1. #1
    Futur Membre du Club
    Inscrit en
    Mars 2007
    Messages
    17
    Détails du profil
    Informations forums :
    Inscription : Mars 2007
    Messages : 17
    Points : 6
    Points
    6
    Par défaut [PHP-JS] Message d'erreur concernant la syntaxe à corriger
    voici le msg:
    Parse error: parse error, unexpected T_ELSE in c:\program files\easyphp1-6\www\projet_2007\devis.php on line 247
    voici le code php:
    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
    <?php
    	// Active tout les warning. Utile en phase de développement
    	// En phase de production, remplacer E_ALL par 0
    	error_reporting(0);
     
    	// Inclus le fichier contenant les fonctions personalisées
    	include_once 'mes_fonctions.php';
     
    	// Fonction de connexion à la base de données
    	connexion_DB('coldeq');
    ?>
    <html>
    <head>
    <meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" />
    <title>Devis</title>
     
    <script language="JavaScript" >
    var mail = /^[\w\-]+(\.[\w\-]+)*@[\w\-]+(\.[\w\-]+)*\.[\w\-]{2,}$/;
     
    function estCeUnMail(champs) {
     reponse=mail.test(champs.value)
     if (reponse==false) {
     return false;
     }
     else
     {return true;}
     }
     
     function testmail(champs) {
     reponse=estCeUnMail(champs);
     if (reponse==false) {alert("Adresse mail Invalide");}
     }
    function test()
    {
     if(document.fformula.zn.value==""||document.fformula.zp.value=="")
     {
     alert("Verifier le champ Nom et Prénom SVP");
     document.fformu1a.zn.focus();
     document.fformu1a.zp.focus();
     return false;
     }
     
     if(document.form1.zadr.value=="")
     {
     alert("Verifier le champ Adresse SVP");
     document.fformu1a.adr.focus();
     return false;
     }
     if(document.fformu1a.ztel.value=="" ) 
     {
     alert("Verifier le numéro de téliphone");
     document.fformu1a.ztel.focus();
     return false;
     }
     if(document.form1.zeml.value=="" ) 
     {
     alert("Verifier votre Email SVP");
     document.fformu1a.zeml.focus();
     return false;
     }
        if (document.getElementById('ch'||'ch2'||'ch3'||'ch4'||'ch5'||'ch6'||'ch7'||'ch8'||'ch9').checked)
    	    { 
    		fformula.action = 'verif.php'; 
            }
     
    else { // Si la checkbox n'est pas cochée	
    	fformula.action = 'devis.php'; 
          }   
         return true;
         }
     </script>
    </head>
     
    <body background="images/froid.jpg">
    <p align="center">&nbsp;&nbsp;&nbsp;</p>
    <p align="center">&nbsp;</p>
    <?php if(!isset($valid)){?>
    <form name="fformula" method="post" action="<?php echo $php_self ?>" onSubmit="return test()">
    <center><strong>Devis</strong></center>
    <div align="center">
        <p align="center">Veuillez remplir le formulaire.<br>
        Les champs précédés d’une<font color="red" size=2> « * » sont obligatoires.</font>
    </div>
    <center>
    <table width="45%" cellspacing="0">
        <tr>
          <th width="37%" scope="col">&nbsp;</th>
          <th width="63%" scope="col">&nbsp;</th>
        </tr><tr>
          <td>Nom<font color="red" size=3>*</font>&nbsp;</td>
          <td><input type="text" name="zn" maxlength=40>&nbsp;</td></tr>
    	  <tr><td>Prénom<font color="red" size=3>*</font>&nbsp;</td>
          <td><input type="text" name="zp" maxlength=40>&nbsp;</td></tr>
    	  <tr><td>Société<font color="red" size=3>*</font>&nbsp;</td>
          <td><input type="text" name="zs" maxlength=40>&nbsp;</td></tr>
    	  <tr> <td>Adresse&nbsp;</td>
          <td><input type="text" name="zadr" maxlength=40>&nbsp;</td></tr>
        <tr><td>Tel<font color="red" size=3>*</font>&nbsp;</td>
          <td><input type="text" name="ztel" maxlength=40>&nbsp;</td></tr>
        <tr><td>Fax&nbsp;</td>
          <td><input type="text" name="zn" maxlength=40>&nbsp;</td></tr>
        <tr><td>Email&nbsp;</td>
          <td><input type="text" name="zeml" maxlength=40 onBlur="testmail(this.form.zeml)">&nbsp;</td></tr>
    </table><br >
      <center><table width="415">
      <tr>
        <td width="200"><div align="left"><strong>Marque de caisse :</strong> </div></td>
    	<td width="200"><div align="left"><strong>Type : </strong></div></td>
        </tr>
      <tr>
        <td><label>
        <div align="right">ISUZU
            <input type="checkbox" name="ch" value="checkbox">
        </div>
        </label></td>
        <td width="203"><label>
            <select name="select">
              <option>Choisissez votre type</option>
              <option>DMax</option>
              <option>NKR66L</option>
              <option>NPR66</option>
              <option>FSR33H</option>
              <option>TFR</option>
            </select>
        </label></td></tr>
      <tr>
        <td><label> 
        <div align="right">MITSUBISHI
            <input type="checkbox" name="ch2" value="checkbox">
          </div>
        </label></td>
        <td><label>
            <select name="select2">
              <option>Choisissez votre type</option>
              <option>L200</option>
              <option>L300</option>
              <option>CANTER</option>
            </select>
        </label></td></tr>
      <tr><td>
        <label> 
        <div align="right">IVECO
          <input type="checkbox" name="ch3" value="checkbox">
        </div>
        </label>
      </td><td><label>
          <select name="select3">
            <option>Choisissez votre type</option>
            <option>EuroCargo</option>
            <option>35 c11</option>
            <option>65.9</option>
          </select>
      </label></td></tr>
      <tr><td><label>
      <div align="right">CITROEN
            <input type="checkbox" name="ch4" value="checkbox">
      </div>
      </label></td>
        <td><label>
          <select name="select4">
            <option>Choisissez votre type</option>
            <option>Berlingo</option>
          </select>
      </label></td></tr>
      <tr><td><label>
      <div align="right">FORD
            <input type="checkbox" name="ch5" value="checkbox">
      </div>
      </label>
        <td><label>
          <select name="select5">
            <option>Choisissez votre type</option>
            <option>Ranger</option>
            <option>Transit</option>
          </select>
      </label></td></tr>
      <tr>
        <td><label>
        <div align="right">RENAULT
            <input type="checkbox" name="ch6" value="checkbox">
        </div>
        </label>  
        <td><label>
            <select name="select6">
              <option>Choisissez votre type</option>
              <option>Kango</option>
            </select>
        </label></td>
      </tr>
      <tr>
        <td><label>
        <div align="right">VOLKSWAGEN
            <input type="checkbox" name="ch7" value="checkbox">
        </div>
        </label>  
        <td><label>
            <select name="select7">
              <option>Choisissez votre type</option>
              <option>Cady</option>
            </select>
        </label></td>
      </tr>
      <tr>
        <td><label>
        <div align="right">MERCEDES
            <input type="checkbox" name="ch8" value="checkbox">
        </div>
        </label>  
        <td><label>
            <select name="select8">
              <option>Choisissez votre type</option>
              <option>Spinter</option>
              <option>Vito</option>
            </select>
        </label></td>
      </tr>
      <tr>
        <td><label></label>  <label>
        <div align="right">PEUGEOT
             <input type="checkbox" name="ch9" value="checkbox">
        </div>
        </label>
        <td><label>
            <select name="select9">
              <option>Choisissez votre type</option>
              <option>Partner</option>
              <option>Boxer</option>
            </select>
        </label></td>
      </tr>
      <tr>
        <td><label>AUTRE
            <input type="text" name="textfield">
        </label>    
      </tr>
    </tab><td><label>Type
            <input type="text" name="textfield2">
        </label></td>                 
      <table height="32" width="571">
        <tr>
          <td height="21" width="152">Choisissez votre devise: &nbsp;</td>
          <td height="21" width="405">                         
    	   <input id="devise" type="radio" CHECKED value="Dinar" name="devise">
            Dinar Tunisien&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
    		<input id="devise" type="radio" value="Dollar" name="devise">
            Dollar Américain&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
    		<input id="devise" type="radio" value="Euro" name="devise">
            Euro&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp 
    		</td></tr></table>
    <center> <table>  
    <tr><td><input type="submit"  value="valider" name="valid"></td>
    <td><input type="reset"  value="Annuler"></td></tr>
    </table>
    </form>
    <?php
    if(isset($ajout))
    				  {$strSQL="select * from client";
    				   $res=$res=requete_SQL($strSQL);
    				   $n=mysql_num_rows($res);
    				   if($n==0)
    				   {
    				  $strSQL = "insert into client (`id_client`,`Nom`,`Prenom`,`Société`,`Adresse`,`Tel`,`Fax`,`email` ) VALUES('','$Nom','$Prenom','$Société','$Adresse','$Tel','$Fax','$email')";
    				  $res=requete_SQL($strSQL);} $res=requete_SQL($strSQL);}
    				  else
    				  {$n=$n+1;
    				  $strSQL = "insert into client (`id_client`,`Nom`,`Prenom`,`Société`,`Adresse`,`Tel`,`Fax`,`email` ) VALUES('','$Nom','$Prenom','$Société','$Adresse','$Tel','$Fax','$email')";
    				  $res=requete_SQL($strSQL);}
    				  }
    ?> 
    </center> 
    </body>
    </html>

  2. #2
    Membre confirmé
    Profil pro
    Inscrit en
    Janvier 2007
    Messages
    466
    Détails du profil
    Informations personnelles :
    Localisation : France

    Informations forums :
    Inscription : Janvier 2007
    Messages : 466
    Points : 632
    Points
    632
    Par défaut
    Bonsoir

    Avant tout pourrais tu nous mettre ton code entre les balise Merci

    Je jette un oeil immediatement a ton code .

    Cordialement

    PS :


    Voila l'erreur :
    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
    if(isset($ajout))
    {
    $strSQL="select * from client";
    $res=$res=requete_SQL($strSQL);
    $n=mysql_num_rows($res);
    
    if($n==0)
    {
    $strSQL = "insert into client (`id_client`,`Nom`,`Prenom`,`Société`,`Adresse`,`Tel`,`Fax`,`email` ) VALUES('','$Nom','$Prenom','$Société','$Adresse','$Tel','$Fax','$email')";
    $res=requete_SQL($strSQL);
    }
    
     $res=requete_SQL($strSQL);
    
    }
    
    else
    {
    $n=$n+1;
    $strSQL = "insert into client (`id_client`,`Nom`,`Prenom`,`Société`,`Adresse`,`Tel`,`Fax`,`email` ) VALUES('','$Nom','$Prenom','$Société','$Adresse','$Tel','$Fax','$email')";
    $res=requete_SQL($strSQL);
    
    }
    
    }//ici une erreur cette accolade me semble en trop ;)

    Pense aussi a aérer ton code dans tes script saut de ligne etc ..

Discussions similaires

  1. [SP-2013] message d'erreur concernant le compte de service
    Par info009 dans le forum SharePoint
    Réponses: 0
    Dernier message: 24/06/2013, 13h33
  2. message d'erreur concernant la langue avec sp_addmessage
    Par FraocH dans le forum Développement
    Réponses: 3
    Dernier message: 19/05/2010, 16h15
  3. Réponses: 5
    Dernier message: 12/06/2008, 18h39
  4. Réponses: 1
    Dernier message: 12/06/2008, 18h03
  5. [PHP-JS] message d'erreur dés le demarrage
    Par luciedoudou dans le forum Langage
    Réponses: 1
    Dernier message: 09/10/2007, 08h50

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