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 :

aide dans un code PHP et MYSQL [MySQL]


Sujet :

PHP & Base de données

  1. #1
    Membre à l'essai
    Homme Profil pro
    Inscrit en
    Janvier 2012
    Messages
    29
    Détails du profil
    Informations personnelles :
    Sexe : Homme

    Informations forums :
    Inscription : Janvier 2012
    Messages : 29
    Points : 15
    Points
    15
    Par défaut aide dans un code PHP et MYSQL
    salut j'ai un site en PHP lié avec une base de donnée MYSQL le fonctionnement du site c'est a partir d'une administration j'ajoute des articles qu'il affiche sur l'acceill et dans la categorie convenable avant que mon fournisseur d'hebergement change la version du PHP du 4.x.x a 5.3.x tous fonctionne tres bien mais apres lorsque j'ecrit un article et je clique sur envoyer il me donne cette erreur

    Erreur SELECT * FROM order by date_ desc You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'order by date_ desc' at line 1
    dans le code php j'ai

    Code : Sélectionner tout - Visualiser dans une fenêtre à part
    1
    2
    3
    4
     
    <?php $sql="SELECT * FROM $table order by date_".$table." desc ";
    $result = mysql_db_query($dbname,$sql) or die ('Erreur '.$sql.' '.mysql_error());
    $n2=mysql_num_rows($result); ?>

  2. #2
    Invité
    Invité(e)
    Par défaut
    Bonjour,
    rien à voir avec la version de PHP.

    Erreur SELECT * FROM ??? order by date_??? desc
    -> Au vu de l'erreur, $table est vide.

  3. #3
    Membre à l'essai
    Homme Profil pro
    Inscrit en
    Janvier 2012
    Messages
    29
    Détails du profil
    Informations personnelles :
    Sexe : Homme

    Informations forums :
    Inscription : Janvier 2012
    Messages : 29
    Points : 15
    Points
    15
    Par défaut
    avant la mise a jour de la version du PHP tous marche tres bien et la table n'est pas vide

  4. #4
    Invité
    Invité(e)
    Par défaut
    A toi de savoir (et de nous dire ?) d'où vient $table.

  5. #5
    Membre à l'essai
    Homme Profil pro
    Inscrit en
    Janvier 2012
    Messages
    29
    Détails du profil
    Informations personnelles :
    Sexe : Homme

    Informations forums :
    Inscription : Janvier 2012
    Messages : 29
    Points : 15
    Points
    15
    Par défaut
    $table c'est le nom du table ou il va stocker l'article car il y a plusieurs table et chaque table nomé par le nom du categorie

  6. #6
    Invité
    Invité(e)
    Par défaut
    Ca, je l'ai très bien compris (d'autant que j'ai fais un système de News similaires !)

    Mais comment veux-tu qu'on t'aide à trouver d'où viens le problème sans nous donner du code, ou sans chercher TOI-MEME avant ??

    Citation Envoyé par mounad Voir le message
    nomé par le nom du categorie
    Comment récupères-tu le nom de la categorie ?
    $_GET ? $_POST ? autre ?
    Sans code ni explications, on ne peut rien pour toi.

  7. #7
    Expert éminent
    Avatar de Benjamin Delespierre
    Profil pro
    Développeur Web
    Inscrit en
    Février 2010
    Messages
    3 929
    Détails du profil
    Informations personnelles :
    Âge : 36
    Localisation : France, Alpes Maritimes (Provence Alpes Côte d'Azur)

    Informations professionnelles :
    Activité : Développeur Web
    Secteur : High Tech - Opérateur de télécommunications

    Informations forums :
    Inscription : Février 2010
    Messages : 3 929
    Points : 7 762
    Points
    7 762
    Par défaut
    Ton script devait dépendre d'une fonctionnalité qui à été dépreciée depuis: les register globals.

    Tu peux jeter un oeil et nous confirmer que c'est ça ?

  8. #8
    Membre à l'essai
    Homme Profil pro
    Inscrit en
    Janvier 2012
    Messages
    29
    Détails du profil
    Informations personnelles :
    Sexe : Homme

    Informations forums :
    Inscription : Janvier 2012
    Messages : 29
    Points : 15
    Points
    15
    Par défaut
    bon lorsque je rentre a l'administration du script et je click sur par exemple ecrir un article dans la categori X il me donne la page suivant qui est specialement pour la categorie X

    categorie_X.php (ajout_nachatat.php le vrais nom du ficier dans le script)

    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
    301
    302
    303
    304
    305
    306
    307
    308
    309
    310
    311
    312
    313
    314
    315
    316
    317
    318
    319
    320
    321
    322
    323
    324
    325
    326
    327
    328
    329
    330
    331
    332
    333
    334
    335
    336
    337
    338
    339
    340
    341
    342
    343
    344
    345
    346
    347
    348
    349
    350
    351
    352
    353
    354
    355
    356
    357
    358
    359
    360
    361
    362
    363
    364
    365
    366
    367
    368
    369
    370
    371
    372
    373
    374
    375
    376
    377
    378
    379
    380
    381
    382
    383
    384
    385
    386
    387
    388
    389
    390
    391
    392
    393
    394
    395
    396
    397
    398
    399
    400
    401
    402
    403
    404
    405
    406
    407
    408
    409
    410
    411
    412
    413
    414
    415
    416
    417
    418
    419
    420
    421
    422
    423
    424
    425
    426
    427
    428
    429
    430
    431
    432
    433
    434
    435
    436
    437
    438
    439
    440
    441
    442
    443
    444
    445
    446
    447
    448
    449
    450
    451
    452
    453
    454
    455
    456
    457
    458
    459
    460
    461
    462
    463
    464
    465
    466
    467
    468
    469
    470
    471
    472
    473
    474
    475
    476
    477
    478
    479
    480
    481
    482
    483
    484
    485
    486
    487
    488
    489
    490
    491
    492
    493
    494
    495
    496
    497
    498
    499
    500
    501
    502
    503
    504
    505
    506
    507
    508
    509
    510
    511
    512
    513
    514
    515
    516
    517
    518
    519
    520
    521
    522
    523
    524
    525
    526
    527
    528
    529
    530
    531
    532
    533
    534
    535
    536
    537
    538
    539
    540
    541
    542
    543
    544
    545
    546
    547
    548
    549
    550
    551
    552
    553
    554
    555
    556
    557
    558
    559
    560
    561
    562
    563
    564
    565
    566
    567
    568
    569
    570
    571
    572
    573
    574
    575
    576
    577
    578
    579
    580
    581
    582
    583
    584
    585
    586
    587
    588
    589
    590
    591
    592
    593
    594
    595
    596
    597
    598
    599
    600
    601
    602
    603
    604
    605
    606
    607
    608
    609
    610
    611
    612
    613
    614
    615
    616
    617
    618
    619
    620
    621
    622
    623
    624
    625
    626
    627
    628
    629
    630
    631
    632
    633
    634
    635
    636
    637
    638
    639
    640
    641
    642
    643
    644
    645
    646
    647
    648
    649
    650
    651
    652
    653
    654
    655
    656
    657
    658
    659
    660
    661
    662
    663
    664
    665
    666
    667
    668
    669
    670
    671
    672
    673
    674
    675
    676
    677
    678
    679
    680
    681
    682
    683
    684
    685
    686
    687
    688
    689
    690
    691
    692
    693
    694
    695
    696
    697
    698
    699
    700
    701
    702
    703
    704
    705
    706
    707
    708
    709
    710
    711
    712
    713
    714
    715
    716
    717
    718
    719
    720
    721
    722
    723
    724
    725
    726
    727
    728
    729
    730
    731
    732
    733
    734
    735
    736
     
    <?php //include('login.php');?>
     
    <?php require_once('conn.php');?>
     
     
     
     
     
    <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
     
    <!-- saved from url=(0036)http://www.styvoo.ch/article389.html -->
     
    <HTML><HEAD><TITLE>UST - </TITLE>
     
    <META http-equiv=Content-Type content="text/html; charset=windows-1256">
     
    <META http-equiv=content-script-type content=text/javascript>
     
    <META http-equiv=content-style-type content=text/css>
     
    <META http-equiv=expires content=0>
     
    <META http-equiv=pragma content=no-cache>
     
    <META http-equiv=identifier-url content=>
     
    <META content=Styvoo name=author>
     
    <META content=Styvoo.Ch name=owner>
     
    <META content=nidam@nidam.ma name=reply-to>
     
    <META content=fr name=language>
     
    <META http-equiv=content-language content="fr, fr-be, fr-ca, fr-lu, fr-ch">
     
    <META 
     
    content="" 
     
    name=description>
     
    <META 
     
    content="" 
     
    name=keywords>
     
    <META content=general name=rating>
     
    <META content=global name=distribution>
     
    <META content=Styvoo.CH name=copyright>
     
    <META content="14 days" name=revisit-after>
     
    <META content=document name=resource-type>
     
    <META content=all name=robots>
     
    <META content="Microsoft FrontPage 5.0" name=GENERATOR>
     
    <style type="text/css">
     
    <!--
     
    body {
     
    	margin-left: 0px;
     
    	margin-top: 0px;
     
    	margin-right: 0px;
     
    	margin-bottom: 0px;
     
    }
     
    .style2 {
     
    	font-family: Verdana, Arial, Helvetica, sans-serif;
     
    	font-size: 12px;
     
    	font-weight: bold;
     
    }
     
    .style8 {font-size: 12px}
     
    .style9 {
     
    	font-family: Verdana, Arial, Helvetica, sans-serif;
     
    	font-size: 10px;
     
    }
     
    -->
     
    </style>
     
     
     
    <LINK 
     
    href="style.css" 
     
    type=text/css rel=StyleSheet>
     
    <SCRIPT language=JavaScript>
     
    <!--
     
    function FrameBuster(){
     
    if (top !=self)
     
    top.location=self.location;
     
    }
     
    // -->
     
    </SCRIPT>
     
    <style>
     
    <!--
     
    h3 {font-family: Arial; font-size: 22; font-weight=normal; color: #000099; line-height: 40px; text-align:center; }
     
    .style2 {	font-family: Verdana, Arial, Helvetica, sans-serif;
     
    	font-size: 12px;
     
    	font-weight: bold;
     
    }
     
    .style8 {font-size: 12px}
     
    .style9 {	font-family: Verdana, Arial, Helvetica, sans-serif;
     
    	font-size: 10px;
     
    }
     
     
     
    -->
     
    </style>
     
    <SCRIPT type=text/javascript>
     
    <!--
     
    function verif_formulaire()
     
    {
     
     if(document.forme1.titre.value == "")  {
     
       alert("Veuillez entrer le titre de votre activité!");
     
       document.forme1.titre.focus();
     
       return false;
     
      }
     
     if(document.forme1.texte.value == "") {
     
       alert("Veuillez entrer votre texte!");
     
       document.forme1.texte.focus();
     
       return false;
     
       }
     
        if(document.forme1.resume.value == "") {
     
       alert("Veuillez entrer votre resume!");
     
       document.forme1.resume.focus();
     
       return false;
     
     
     
      }
     
      }
     
    //-->
     
    </SCRIPT>
     
     
     
    </HEAD>
     
    <BODY dir="rtl" leftMargin=1 topMargin=1 marginheight="1" marginwidth="1">
     
    <div align="center">
     
      <center>
     
    <TABLE class=bodyline cellSpacing=0 cellPadding=0 width="765" border=0 style="border-collapse: collapse" bordercolor="#111111">
     
      <TBODY>
     
      <TR>
     
        <TD width="763"  align=center vAlign=top>
     
          <TABLE class=topbkg cellSpacing=0 cellPadding=0 width="763" border=0 style="border-collapse: collapse; background-color:#FFFFFF" bordercolor="#111111" height="84">
     
            <TBODY>
     
            <TR>
     
              <TD width="38" height=5 dir="ltr" colspan="2">
     
              </TD>
     
              <TD width="302" height=84 rowspan="2">
     
              <table border="0" cellpadding="0" cellspacing="0" style="border-collapse: collapse" bordercolor="#111111" width="100%" id="AutoNumber1" height="89">
     
                <tr>
     
                  <td width="100%" height="34">
     
                  <p align="right">
     
                                    <b>
     
                                    <font face="Arial" size="9" color="#CC6600">
     
                                    <span lang="ar-ma">الا</span>اتحاد النقابي للاتصالات</font></b><FONT face="AL-Mohanad Bold" 
     
                                    color=#005EB2 size=6><B><span lang="ar-ma">
     
                  </span></B></FONT></td>
     
                </tr>
     
                <tr>
     
                  <td width="100%" height="55">
     
                  <p align="right"><b><span lang="ar-ma"><font size="4">شركاء لا 
     
                  أجراء</font></span></b></p>
     
                  <p></td>
     
                </tr>
     
              </table>
     
              </TD>
     
              <TD width="132" height=84 rowspan="2">          <img border="0" src="images/tandhim.gif" width="300" height="31"></TD>
     
            </TR>
     
            <TR>
     
              <TD width="1" height=41 dir="ltr">
     
              <p align="center">
     
              </TD>
     
              <TD width="37" height=41 dir="ltr"><img border="0" src="images/logo_umt.gif" align="right" width="89" height="92"> </TD>
     
            </TR>
     
            </TBODY></TABLE>
     
          <div align="right">
     
          <TABLE cellSpacing=0 cellPadding=2 width="100%" border=0 style="border-collapse: collapse" bordercolor="#111111">
     
            <TBODY>
     
            <TR>
     
              <TD class=topnav noWrap width="106" style="background-color: #FFFFFF; background-image: url('images/cellpic3.gif')">
     
                <DIV align=left><font size="1" face="Aharoni" color="#99CCFF">
     
                  <!--webbot bot="Timestamp" S-Type="EDITED" S-Format="%d/%m/%Y" startspan --><? echo date('d/m/y');?><!--webbot bot="Timestamp" endspan i-checksum="12538" --></font></DIV></TD>
     
              <TD class=topnav noWrap width="105" style="background-color: #FFFFFF; background-image: url('images/cellpic3.gif')">
     
    </TD>
     
              <TD class=topnav noWrap width="121" style="background-color: #FFFFFF; background-image: url('images/cellpic3.gif')">
     
                        </TD>
     
              <TD class=topnav noWrap width="101" style="background-color: #FFFFFF; background-image: url('images/cellpic3.gif')">
    		  <p align="center"><a href="ajout_mahatat.php"><b>
     
                                      <font face="AL-Mohanad Bold" color="#DEEEF3" size="6">
     
                        اضافة اجتماعيات</font></b></a>
     
     
     
                        </TD>
     
              <TD class=topnav noWrap width="102" style="background-color: #FFFFFF; background-image: url('images/cellpic3.gif')">
     
                <p align="center"><a href="ajout_moudakira.php"><span lang="ar-ma"><b><font color="#DEEEF3">اضافة مذكــــــرة</font></b></span></a></TD>
     
              <TD class=topnav noWrap width="102" style="background-color: #FFFFFF; background-image: url('images/cellpic3.gif')">
     
                <p align="center"><a href="ajout_bayanat.php"><b>
     
                                      <font face="AL-Mohanad Bold" color="#DEEEF3" size="6">
     
                        اضافة بيان</font></b></a></TD>
     
              <TD class=topnav noWrap width="102" style="background-color: #FFFFFF; background-image: url('images/cellpic3.gif')">
     
                <p align="center"><a href="ajout_nachatat.php"><b>
     
                                      <font face="AL-Mohanad Bold" color="#DEEEF3" size="6">
     
                        اضافة خبر </font></b></a></TD>
     
              </TR></TBODY></TABLE>
     
          </div>
     
          <TABLE class=tbl cellSpacing=0 cellPadding=0 border=0>
     
            <TBODY>
     
            <TR>
     
              <TD class=tbll>
     
              <IMG height=4 alt="" 
     
                src="images/spacer.gif" 
     
                width=8></TD>
     
              <TD class=tblbot>
     
              <IMG height=4 alt="" 
     
                src="images/spacer.gif" 
     
                width=8></TD>
     
              <TD class=tblr>
     
              <IMG height=4 alt="" 
     
                src="images/spacer.gif" 
     
                width=8></TD></TR></TBODY></TABLE>
     
          <TABLE cellSpacing=0 cellPadding=0 width="100%" align=center border=0>
     
            <TBODY>
     
            <TR vAlign=top>
     
              <TD>
     
              <IMG height=1 alt="" 
     
                src="images/spacer.gif" 
     
                width=1 border=0></TD></TR></TBODY></TABLE>
     
          <div align="center">
     
          <TABLE cellSpacing=0 cellPadding=0 width="100%" border=0 style="border-collapse: collapse" bordercolor="#111111" >
     
            <TBODY>
     
            <TR vAlign=top>
     
     
     
              <TD vAlign=top width="100%" >
     
                <TABLE width="100%" border=0 style="border-collapse: collapse" bordercolor="#111111" cellpadding="0" cellspacing="0">
     
                  <TBODY>
     
                  <TR>
     
                    <TD vAlign=top >
     
                      <TABLE cellSpacing=0 cellPadding=4 width="100%" border=0>
     
                        <TBODY>
     
                        <TR>
     
                          <TD>
     
                            <TABLE cellSpacing=0 cellPadding=1 width="100%"
     
    border=0 >
     
                              <TBODY>
     
                              <TR>
     
                                <TD bgColor=#006699  >
     
                                  <TABLE cellSpacing=0 cellPadding=0 width="100%" 
     
                                  border=0>
     
                                    <TBODY>
     
                                    <TR>
     
                                    <TD height="321" bgColor=#ffffff>
     
                                    <TABLE cellSpacing=1 cellPadding=0  width="100%" 
     
                                    border=0 >
     
                                    <TBODY>
     
                                    <TR>
     
                                    <TD 
     
                                    background="images/cellpic1.gif" 
     
                                    bgColor=#eaedf4 height=26>
     
                                    <p dir="rtl" align="center"><B>
     
                                    <span lang="ar-ma">
     
                                    <FONT face="AL-Mohanad Bold" 
     
                                    color=#FFFFFF size=6>&nbsp;</FONT><FONT face="AL-Mohanad Bold" 
     
                                    color=#5C81B1 size=6>&nbsp;</FONT><FONT face="AL-Mohanad Bold" 
     
                                    color=#000099 size=6> </FONT>
     
                                    </span>
     
                                    <FONT face="AL-Mohanad Bold" 
     
                                    color=#000099 size=6>تسييرالموقع</FONT></B></TD></TR>
     
                                    <TR>
     
                                    <TD height="280" bgColor=#FFFFFF >
     
                                    &nbsp;
     
    								<table width="730" border="0" align="center" cellpadding="3" cellspacing="0">
     
                                      <tr>
     
                                        <td width="647" height="36" valign="middle">                                      
     
                                              <div align="right" class="maintitle2 "> <span class="maintitle3 "></span> اضافة خبر::</div></td>
     
                                        <td width="27" valign="top" ><div align="right" class="maintitle3 "></div></td>
     
                                        <td width="66" >&nbsp;</td>
     
                                      </tr>
     
                                      <tr>
     
                                        <td height="18" valign="middle">&nbsp;</td>
     
                                        <td valign="top" >&nbsp;</td>
     
                                        <td >&nbsp;</td>
     
                                      </tr>
     
                                      <tr>
     
                                        <td height="450" colspan="3" valign="top"><? $table="nachatat";?>
     
                                          <form method="post" name="forme1" action="ajout2.php?table=<? echo $table;?>"  onsubmit="return verif_formulaire()" enctype="multipart/form-data">
     
                                            <table width="523" border="0" align="center" cellpadding="3" cellspacing="1" >
     
                                              <tr valign="baseline" bgcolor="#FFFFFF">
     
     
     
                                                <td width="176"><div align="right" class="maintitle">  عنوان الخبر:</div></td>
     
    											<td width="332"><span lang="ar-ma"><input name="titre" type="text"  value="" size="61" class="zone"></span></td>
     
                                              </tr>
     
                                              <tr valign="baseline" bgcolor="#FFFFFF">
     
     
     
                                                <td valign="top" > <div align="right" class="maintitle">  موجز الخبر:</div></td>
     
    											<td><textarea name="resume" cols="60" rows="8" class="zone2"></textarea></td>
     
                                              </tr>
     
    										   <tr valign="baseline" bgcolor="#FFFFFF">
     
     
     
                                                <td valign="top"><div align="right" class="maintitle"> تفاصيل الخبر:</div></td>
     
    											<td><textarea name="texte" cols="60" rows="8" class="zone2"></textarea></td>
     
                                              </tr>
     
     
     
                                              <tr valign="baseline" bgcolor="#FFFFFF">
     
     
                                                <td><div align="right" class="maintitle"> تاريخ الخبر:</div></td>
     
     
                                                <td>
     
                                                  <div align="right">
     
                                                    <input type="text" name="date" value="<?=date("Y-m-d"); ?>" size="25" class="zone">
     
                                                    <span class="style9">(aaaa-mm-jj) </span></div></td>
     
     
                                              </tr>
     
                                              <tr valign="baseline" bgcolor="#FFFFFF">
     
     
     
                                                <td><div align="right" class="maintitle"> صورة للخبر:</div></td>
     
    											<td><div align="right"><span class="style8">
     
                                                    <input name="fic" type="file" id="fic" size="50">
    												<input name="MAX_FILE_SIZE" type="hidden" id="MAX_FILE_SIZE">
     
     
                                                </span></div></td>
     
                                              </tr>
     
                                              <tr valign="baseline" bgcolor="#FFFFFF">
     
     
     
                                                <td align="right" nowrap>&nbsp;</td>
     
    											<td height="41" align="right" valign="bottom" nowrap><input name="submit" type="submit" value="Enregistrer" class="ok"></td>
     
                                              </tr>
     
                                            </table>
     
                                            <input type="hidden" name="MM_insert" value="form1">                                    
     
                                              </form></td>
     
                                      </tr>
     
                                      <tr>
     
                                        <td height="37" valign="middle"><div align="right" class="maintitle2">قائمة الاخبار <span class="maintitle3">::</span></div></td>
     
                                        <td height="37" valign="top"><div align="right" class="maintitle3"></div></td>
     
                                        <td height="37"></td>
     
                                      </tr>
     
                                      <tr>
     
                                        <td colspan="3"><table width="740" border="0" cellpadding="3" cellspacing="1" bgcolor="#999999">
     
                                            <tr bgcolor="#FFFFFF">
     
                                              <td width="139"><span class="style2">Date</span></td>
     
                                              <td width="410"><span class="style2">Titre</span></td>
     
                                              <td colspan="2" align="center"><span class="style2">Action</span></td>
     
                                            </tr>
     
                                          	<?php
    												// NOMBRE DE RESULTATS PAR PAGE
    												$limit=10;
     
    												// NOM DE CE SCRIPT
    												$script_name="ajout_nachatat.php";
     
    												//  PROGRAMME PRINCIPAL
     
    												if($debut==""){$debut=0;}
    												$debut=$page*$limit;
     
    												$sql="SELECT count(*) FROM nachatat order by date_nachatat desc";
                			                        $result = mysql_db_query($dbname,$sql) or die ('Erreur '.$sql.' '.mysql_error());
    												$nb_total=mysql_result($result,0,"count(*)");
    												$result=mysql_db_query($dbname,"select * from nachatat order by date_nachatat desc limit $debut,$limit");
    			                                    $n2=mysql_num_rows($result);
     
    			                                    if ($n2>0){ for($i=0;$i<$n2;$i++) {$ligne=mysql_fetch_row($result);
     
     
                                       		?>
     
                                                                                      <tr  bgcolor="#FFFFFF" class="style9">
     
                                                                                      <td ><?php echo $ligne[4]; ?></td>
     
                                                                                      <td><?php echo $ligne[1]; ?></td>
     
                                                                                      <td width="69" align="center"><a href="modifier_nachatat.php?id=<?php echo $ligne[0]."&table=$table"; ?>" class="style9">Modifier</a></td>
     
                                                                                      <td width="93" align="center"><a href="supprimer.php?id=<?php echo $ligne[0]."&table=$table"; ?>" class="style9">supprimer</a></td>
     
                                                                                      </tr>
     
                                            <?php } // Show if recordset not empty ?>
     
                                            <?php }// while ($row_list_actualite = mysql_fetch_assoc($list_actualite)); ?>
     
                                        </table></td>
     
                                      </tr>
    								<tr><td><?  echo "<p align=\"center\"><font color=\"#006699\"><span lang=\"ar-ma\"><b><font size=\"2\">";
    										//AFFICHAGE DU LIEN PRECEDENT SI BESOIN												
    										if ($page>0)
    										{
    											$precedent=$page-1;
    											print  "<a href=\"$script_name?page=$precedent&nachat=$j\">السابق</a>&nbsp;\n";
    										}
     
    										// AFFICHAGE DES NUMEROS DE PAGE
    										$i=0;$j=1;
    										if($nb_total>$limit)
    										{
    											while($i<($nb_total/$limit))
    											{
    												if($i!=$page){echo "<a href=\"$script_name?page=$i&nachat=$j\">$j</a>&nbsp;";}
    												else {echo "<font color=\"#111111\">$j</font>&nbsp;";}
    											$i++;$j++;
    											}
    										}
     
    										// AFFICHAGE DU LIEN SUIVANT SI BESOIN
    										if($debut+$limit<$nb_total)
    										{
    											$suivant=$page+1;
    											echo "<a href=\"$script_name?page=$suivant&nachat=$j\">التالى</a>";
    										}							
    										echo "</font></b></span></font><HR color=\"#000000\"></p>";?></td></tr>
     
                                    </table></TD></TR>
     
                                    </TBODY></TABLE></TD></TR></TBODY></TABLE></TD></TR></TBODY></TABLE>
     
                            </TD>
     
                        </TR></TBODY></TABLE></TD>
     
                    </TR></TBODY></TABLE>
     
                </TD></TR></TBODY></TABLE>
     
          </div>
     
          <FONT class=footmsg>
     
     
     
          <TABLE cellPadding=4 width="765" border=0>
     
            <TBODY>
     
            <tr>
     
                          <TD bgColor=#D1D8E7 width="809">
     
                            <p align="center"><b>
     
          <FONT class=footmsg>
     
     
     
                            <font face="Arial" color="#5C81B1" size="1">
     
                            <span lang="ar-ma">الاتحاد</span></font></FONT><font face="Arial" color="#5C81B1" size="1"> 
     
                            النقابي للاتصالات<span lang="ar-ma"> 
     
                            المنضوي تحت الاتحاد 
     
                            المغربي للشغل</span></font></b></TD>
     
            </tr>
     
            </TBODY></TABLE>
     
          </FONT></FORM></TR></TBODY></TABLE>
     
      </center>
     
    </div>
     
     
     
    </BODY></HTML>

    et apres la remplissement du formulaire et le clique sur bouton envoyer il me redirect vers la page ajout2.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
    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
    301
    302
    303
    304
    305
    306
    307
    308
    309
    310
    311
    312
    313
    314
    315
    316
    317
    318
    319
    320
    321
    322
    323
    324
    325
    326
    327
    328
    329
    330
    331
    332
    333
    334
    335
    336
    337
    338
    339
    340
    341
    342
    343
    344
    345
    346
    347
    348
    349
    350
    351
    352
    353
    354
    355
    356
    357
    358
    359
    360
    361
    362
    363
    364
    365
    366
    367
    368
    369
    370
    371
    372
    373
    374
    375
    376
    377
    378
     
    <?php require_once('conn.php');?>
    <?
     
           function transfert() {
    		$ret = false;
    		$img_blob = '';
    		$img_largeur = 0;
    		$img_hauteur = 0;
    		$img_nom = '';
    		$img_taille = 0;
    		$img_type = '';
    		$taille_max = 500000;
            $titre=$_POST['titre'];
            $table=$_GET['table'];
            $resume=$_POST['resume'];
            $date=$_POST['date'];
            $texte=$_POST['texte'];
     
    		$ret = is_uploaded_file($_FILES['fic']['tmp_name']);
    		if(!$ret) {
    			echo "<br>\n";
    			$req = "INSERT INTO nachatat(".
    								"nom_nachatat, nachatat, resume_nachatat, date_nachatat, img_nom, img_taille, img_largeur, img_hauteur, img_type, img_desc, img_blob ".
    								") VALUES (".
                                     "'".$titre."', ".
    								 "'".$texte."', ".
                                      "'".$resume."', ".
    								  "'".$date."', ".
                                     "'".NULL."', ".
                                     "'".NULL."', ".
                                     "'".NULL."', ".
    								"'".NULL."', ".
    								"'".NULL."', ".
    								"'"."Essai"."', ".
    								"'".addslashes($img_blob)."')";
    			$ret = mysql_query($req)
    				or die(mysql_error());
    			return false;
    		}
    		else {
    			// Le fichier a bien été reçu.
    			$infos_img = getimagesize($_FILES['fic']['tmp_name']);
    			$img_largeur = $infos_img[0];
    			$img_hauteur = $infos_img[1];
    			$img_taille = $_FILES['fic']['size'];
    			if($img_taille > $taille_max) {
    				echo "Fichier trop gros...<br>\n";
    				return false;
    			}
    			$img_type = $_FILES['fic']['type'];
    			$img_nom = $_FILES['fic']['name'];
     
    			include("conn.php");
     
    			$img_blob = file_get_contents($_FILES['fic']['tmp_name']);
     
    			$req = "INSERT INTO nachatat(".
    								"nom_nachatat, nachatat, resume_nachatat, date_nachatat, img_nom, img_taille, img_largeur, img_hauteur, img_type, img_desc, img_blob ".
    								") VALUES (".
                                     "'".$titre."', ".
    								 "'".$texte."', ".
                                      "'".$resume."', ".
    								  "'".$date."', ".
                                     "'".$img_nom."', ".
                                     "'".$img_taille."', ".
                                     "'".$img_largeur."', ".
    								"'".$img_hauteur."', ".
    								"'".$img_type."', ".
    								"'"."Essai"."', ".
    								"'".addslashes($img_blob)."')";
    			$ret = mysql_query($req)
    				or die(mysql_error());
     
    			return true;
    		}
    	}
       if ($table=="nachatat") {
    		transfert();
     
    							}
                                                          //$sql="SELECT * FROM $table where nom_nachatat='$titre' and resume_nachatat='$resume' and nachatat='$texte' and date_nachatat='$date' ";
                                                          //$result = mysql_db_query($dbname,$sql) or die ('Erreur '.$sql.' '.mysql_error());
       	                                                  //$ligne=mysql_fetch_row($result);
    													  //$id=$ligne[0];
     
                                               //          $id=mysql_insert_id() ;echo $id;
                                                     //  if(move_uploaded_file($file,"uploads/".$id.".jpg")) {
     
    											//		if(move_uploaded_file($file,"img_nachat/".$id.".jpg")) {
    	                                               //   $path="img_nachat/".$id.".jpg";
    													 /* $DESTINATION_FOLDER = $path;
    													  $nomTemporaire=$_POST['file'];//$_FILES["file"]["name"];	
    													  $nomFichier=$id; */
     
                                             //               echo "réussi";
                                             //         }else {
                                             //            echo "echec";
                                            //     }
                                                      //  echo "réussi";else echo "echec";}
    													//  $uploadOk = move_uploaded_file($nomTemporaire, $DESTINATION_FOLDER.$nomFichier); */
     
                                            //     }
                       //    }     
       ?>
     
     
    <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
    <!-- saved from url=(0036)http://www.styvoo.ch/article389.html -->
    <HTML><HEAD><TITLE>UST - </TITLE>
    <META http-equiv=Content-Type content="text/html; charset=windows-1256">
    <META http-equiv=content-script-type content=text/javascript>
    <META http-equiv=content-style-type content=text/css>
    <META http-equiv=expires content=0>
    <META http-equiv=pragma content=no-cache>
    <META http-equiv=identifier-url content=>
    <META content=Styvoo name=author>
    <META content=Styvoo.Ch name=owner>
    <META content=nidam@nidam.ma name=reply-to>
    <META content=fr name=language>
    <META http-equiv=content-language content="fr, fr-be, fr-ca, fr-lu, fr-ch">
    <META 
    content="" 
    name=description>
    <META 
    content="" 
    name=keywords>
    <META content=general name=rating>
    <META content=global name=distribution>
    <META content=Styvoo.CH name=copyright>
    <META content="14 days" name=revisit-after>
    <META content=document name=resource-type>
    <META content=all name=robots>
    <META content="Microsoft FrontPage 5.0" name=GENERATOR>
    <style type="text/css">
    <!--
    body {
    	margin-left: 0px;
    	margin-top: 0px;
    	margin-right: 0px;
    	margin-bottom: 0px;
    }
    .style2 {
    	font-family: Verdana, Arial, Helvetica, sans-serif;
    	font-size: 12px;
    	font-weight: bold;
    }
    .style8 {font-size: 12px}
    .style9 {
    	font-family: Verdana, Arial, Helvetica, sans-serif;
    	font-size: 10px;
    }
    -->
    </style>
     
    <LINK 
    href="style.css" 
    type=text/css rel=StyleSheet>
    <SCRIPT language=JavaScript>
    <!--
    function FrameBuster(){
    if (top !=self)
    top.location=self.location;
    }
    // -->
    </SCRIPT>
    <style>
    <!--
    h3 {font-family: Arial; font-size: 22; font-weight=normal; color: #000099; line-height: 40px; text-align:center; }
    .style2 {	font-family: Verdana, Arial, Helvetica, sans-serif;
    	font-size: 12px;
    	font-weight: bold;
    }
    .style8 {font-size: 12px}
    .style9 {	font-family: Verdana, Arial, Helvetica, sans-serif;
    	font-size: 10px;
    }
    .Style11 {color: #003399}
     
    -->
    </style>
     
     
    </HEAD>
    <BODY leftMargin=1 topMargin=1 marginheight="1" marginwidth="1">
    <div align="center">
      <center>
    <TABLE class=bodyline cellSpacing=0 cellPadding=0 width="765" border=0 style="border-collapse: collapse" bordercolor="#111111">
      <TBODY>
      <TR>
        <TD width="763"  align=center vAlign=top>
          <TABLE class=topbkg cellSpacing=0 cellPadding=0 width="763" border=0 style="border-collapse: collapse; background-color:#FFFFFF" bordercolor="#111111" height="84">
            <TBODY>
            <TR>
              <TD width="38" height=5 dir="ltr" colspan="2">
              </TD>
              <TD width="302" height=84 rowspan="2">
              <table border="0" cellpadding="0" cellspacing="0" style="border-collapse: collapse" bordercolor="#111111" width="100%" id="AutoNumber1" height="89">
                <tr>
                  <td width="100%" height="34">
                  <p align="right">
                                    <b>
                                    <font face="Arial" size="9" color="#CC6600">
                                    <span lang="ar-ma">الا</span>اتحاد النقابي للاتصالات</font></b><FONT face="AL-Mohanad Bold" 
                                    color=#005EB2 size=6><B><span lang="ar-ma">
                  </span></B></FONT></td>
                </tr>
                <tr>
                  <td width="100%" height="55">
                  <p align="right"><b><span lang="ar-ma"><font size="4">شركاء لا 
                  أجراء</font></span></b></p>
                  <p></td>
                </tr>
              </table>
              </TD>
              <TD width="132" height=84 rowspan="2">
              <img border="0" src="images/logo_umt.gif" align="right" width="89" height="92"></TD>
            </TR>
            <TR>
              <TD width="1" height=41 dir="ltr">
              <p align="center">
              </TD>
              <TD width="37" height=41 dir="ltr">
              <img border="0" src="images/tandhim.gif" width="300" height="31"></TD>
            </TR>
            </TBODY></TABLE>
          <div align="right">
          <TABLE cellSpacing=0 cellPadding=2 width="100%" border=0 style="border-collapse: collapse" bordercolor="#111111">
            <TBODY>
            <TR>
              <TD class=topnav noWrap width="106" style="background-color: #FFFFFF; background-image: url('images/cellpic3.gif')">
                <DIV align=left><font size="1" face="Aharoni" color="#99CCFF">
                  <!--webbot bot="Timestamp" S-Type="EDITED" S-Format="%d/%m/%Y" startspan --><? echo date('d/m/y');?><!--webbot bot="Timestamp" endspan i-checksum="12538" --></font></DIV></TD>
              <TD class=topnav noWrap width="105" style="background-color: #FFFFFF; background-image: url('images/cellpic3.gif')">
    </TD>
              <TD class=topnav noWrap width="121" style="background-color: #FFFFFF; background-image: url('images/cellpic3.gif')">
                        </TD>
              <TD class=topnav noWrap width="101" style="background-color: #FFFFFF; background-image: url('images/cellpic3.gif')">
     
                        </TD>
              <TD class=topnav noWrap width="102" style="background-color: #FFFFFF; background-image: url('images/cellpic3.gif')">
                <p align="center"><a href="ajout_moudakira.php"><span lang="ar-ma"><b><font color="#DEEEF3">اضافة مذكــــــرة</font></b></span></a></TD>
              <TD class=topnav noWrap width="102" style="background-color: #FFFFFF; background-image: url('images/cellpic3.gif')">
                <p align="center"><a href="ajout_bayanat.php"><b>
                                      <font face="AL-Mohanad Bold" color="#DEEEF3" size="6">
                        اضافة بيان</font></b></a></TD>
              <TD class=topnav noWrap width="102" style="background-color: #FFFFFF; background-image: url('images/cellpic3.gif')">
                <p align="center"><a href="ajout_nachatat.php"><b>
                                      <font face="AL-Mohanad Bold" color="#DEEEF3" size="6">
                        اضافة نشاط</font></b></a></TD>
              </TR></TBODY></TABLE>
          </div>
          <TABLE class=tbl cellSpacing=0 cellPadding=0 border=0>
            <TBODY>
            <TR>
              <TD class=tbll>
              <IMG height=4 alt="" 
                src="images/spacer.gif" 
                width=8></TD>
              <TD class=tblbot>
              <IMG height=4 alt="" 
                src="images/spacer.gif" 
                width=8></TD>
              <TD class=tblr>
              <IMG height=4 alt="" 
                src="images/spacer.gif" 
                width=8></TD></TR></TBODY></TABLE>
          <TABLE cellSpacing=0 cellPadding=0 width="100%" align=center border=0>
            <TBODY>
            <TR vAlign=top>
              <TD>
              <IMG height=1 alt="" 
                src="images/spacer.gif" 
                width=1 border=0></TD></TR></TBODY></TABLE>
          <div align="center">
          <TABLE cellSpacing=0 cellPadding=0 width="100%" border=0 style="border-collapse: collapse" bordercolor="#111111" >
            <TBODY>
            <TR vAlign=top>
     
              <TD vAlign=top width="100%" >
                <TABLE width="100%" border=0 style="border-collapse: collapse" bordercolor="#111111" cellpadding="0" cellspacing="0">
                  <TBODY>
                  <TR>
                    <TD vAlign=top >
                      <TABLE cellSpacing=0 cellPadding=4 width="100%" border=0>
                        <TBODY>
                        <TR>
                          <TD>
                            <TABLE cellSpacing=0 cellPadding=1 width="100%"
    border=0 >
                              <TBODY>
                              <TR>
                                <TD bgColor=#006699  >
                                  <TABLE cellSpacing=0 cellPadding=0 width="100%" 
                                  border=0>
                                    <TBODY>
                                    <TR>
                                    <TD height="321" bgColor=#ffffff>
                                    <TABLE cellSpacing=1 cellPadding=0  width="100%" 
                                    border=0 >
                                    <TBODY>
                                    <TR>
                                    <TD 
                                    background="images/cellpic1.gif" 
                                    bgColor=#eaedf4 height=26>
                                    <p dir="rtl" align="center"><B>
                                    <span lang="ar-ma">
                                    <FONT face="AL-Mohanad Bold" 
                                    color=#FFFFFF size=6>&nbsp;</FONT><FONT face="AL-Mohanad Bold" 
                                    color=#5C81B1 size=6>&nbsp;</FONT><FONT face="AL-Mohanad Bold" 
                                    color=#000099 size=6> </FONT>
                                    </span>
                                    <FONT face="AL-Mohanad Bold" 
                                    color=#000099 size=6>تسييرالموقع</FONT></B></TD></TR>
                                    <TR>
                                    <TD height="280" bgColor=#FFFFFF valign="top">
                                    &nbsp;
    								<table width="730" border="0" align="center" cellpadding="0" cellspacing="0">
                                      <tr>
                                        <td colspan="3" valign="top"></td>
                                      </tr>
                                      <tr>
                                        <td width="647" height="37" valign="middle"><div align="right" class="maintitle2">قائمة <? if ($table=="nachatat") echo"النشاطات" ;else if ($table=="bayanat") echo"البيانات";else echo "المذكرات";?></div></td>
                                        <td width="27" height="37" valign="top"><div align="right" class="maintitle3">::</div></td>
                                        <td width="66" height="37"></td>
                                      </tr>
                                      <tr>
                                        <td colspan="3"><table width="740" border="0" cellpadding="3" cellspacing="1" bgcolor="#999999">
                                            <tr bgcolor="#FFFFFF">
                                              <td width="139"><span class="style2">Date</span></td>
                                              <td width="410"><span class="style2">Titre</span></td>
                                              <td colspan="2" align="center"><span class="style2">Action</span></td>
                                            </tr>
                                            <?php $sql="SELECT * FROM $table order by date_".$table." desc ";
                                                   $result = mysql_db_query($dbname,$sql) or die ('Erreur '.$sql.' '.mysql_error());
                                                   $n2=mysql_num_rows($result); ?>
                                            <?php if ($n2>0){ for($i=0;$i<$n2;$i++) {$ligne=mysql_fetch_row($result); // Show if recordset not empty ?>
                                                                                      <tr  bgcolor="#FFFFFF" class="style9">
                                                                                      <? if ($table<>"moudakira"){?> <td ><?php echo $ligne[4]; ?></td><? }
    																				  else {?> <td ><?php echo $ligne[3]; ?></td> <? }?>
                                                                                      <td><?php echo $ligne[1]; ?></td>
                                                                                      <td width="69" align="center"><a href="modifier_<? echo $table;?>.php?id=<?php echo $ligne[0]."&table=$table"; ?>" class="style9">Modifier</a></td>
                                                                                      <td width="93" align="center"><a href="supprimer.php?id=<?php echo $ligne[0]."&table=$table"; ?>" class="style9">supprimer</a></td>
                                                                                      </tr>
                                            <?php } // Show if recordset not empty ?>
                                            <?php }// while ($row_list_actualite = mysql_fetch_assoc($list_actualite)); 
    										  print"<script>top.location.replace('ajout_$table.php');</script>";
    										?>
                                        </table></td>
                                      </tr>
                                    </table></TD></TR>
                                    </TBODY></TABLE></TD></TR></TBODY></TABLE></TD></TR></TBODY></TABLE>
                            </TD>
                        </TR></TBODY></TABLE></TD>
                    </TR></TBODY></TABLE>
                </TD></TR></TBODY></TABLE>
          </div>
          <FONT class=footmsg>
     
          <TABLE cellPadding=4 width="765" border=0>
            <TBODY>
            <tr>
                          <TD bgColor=#D1D8E7 width="809">
                            <p align="center"><b>
          <FONT class=footmsg>
     
                            <font face="Arial" color="#5C81B1" size="1">
                            <span lang="ar-ma">الاتحاد</span></font></FONT><font face="Arial" color="#5C81B1" size="1"> 
                            النقابي للاتصالات<span lang="ar-ma"> 
                            المنضوي تحت الاتحاد 
                            المغربي للشغل</span></font></b></TD>
            </tr>
            </TBODY></TABLE>
          </FONT></FORM></TR></TBODY></TABLE>
      </center>
    </div>
     
    </BODY></HTML>
    apres le clique sur envoyer il me donne l'erreur

    le script est en arabe pour sa il ya des mot en arabe

  9. #9
    Invité
    Invité(e)
    Par défaut
    lignes 499-501 :
    Code : Sélectionner tout - Visualiser dans une fenêtre à part
    1
    2
    3
                                        <td height="450" colspan="3" valign="top"><? $table="nachatat";?>
     
                                          <form method="post" name="forme1" action="ajout2.php?table=<? echo $table;?>"  onsubmit="return verif_formulaire()" enctype="multipart/form-data">
    => Il faut que tu changes PARTOUT et DANS TOUS LES FICHIERS <? en <?php
    +
    => les balises html s'écrivent en minuscules (<head>, <script>, <table>.....)
    +
    => les attribut s'écrivent avec des guillements : <balise attr="..." ... >

  10. #10
    Membre à l'essai
    Homme Profil pro
    Inscrit en
    Janvier 2012
    Messages
    29
    Détails du profil
    Informations personnelles :
    Sexe : Homme

    Informations forums :
    Inscription : Janvier 2012
    Messages : 29
    Points : 15
    Points
    15
    Par défaut
    ok je vé essai meme si avan il marche tres bien

  11. #11
    Membre à l'essai
    Homme Profil pro
    Inscrit en
    Janvier 2012
    Messages
    29
    Détails du profil
    Informations personnelles :
    Sexe : Homme

    Informations forums :
    Inscription : Janvier 2012
    Messages : 29
    Points : 15
    Points
    15
    Par défaut
    j'ai remplacer <? en <?php mais encore le meme probe

  12. #12
    Invité
    Invité(e)
    Par défaut
    Bonjour,
    on ne peut pas faire tout le travail à ta place.
    => Tu sais quoi chercher ($table)
    => tu dois trouver pourquoi il est vide.

    Il faut TROUVER à quel moment, à quel endroit du code elle NE SE REMPLIT PAS, ok ?

    Regarde dans ajout_nachatat.php :
    Code : Sélectionner tout - Visualiser dans une fenêtre à part
    1
    2
    3
    4
    5
    <!-- C'EST ICI QU'ON DÉFINIT $table -->
                                        <td height="450" colspan="3" valign="top"><?php $table="nachatat";?>
     
     <!-- C'EST ICI QU'ON ENVOIE $table VIA L'URL -->
                                         <form method="post" name="forme1" action="ajout2.php?table=<?php echo $table;?>"  onsubmit="return verif_formulaire()" enctype="multipart/form-data">
    ET dans ajout2.php (dans la function transfert()) :
    Code : Sélectionner tout - Visualiser dans une fenêtre à part
    1
    2
    3
    4
    5
    6
    7
    8
    9
    10
    11
    12
           function transfert() {
    		$ret = false;
    		$img_blob = '';
    		$img_largeur = 0;
    		$img_hauteur = 0;
    		$img_nom = '';
    		$img_taille = 0;
    		$img_type = '';
    		$taille_max = 500000;
            $titre=$_POST['titre'];
    // ICI, ON RÉCUPÈRE $table dans L'URL
           $table=$_GET['table'];
    Plus loin dans le code, on trouve :
    Code : Sélectionner tout - Visualiser dans une fenêtre à part
    1
    2
       if ($table=="nachatat") {
    		transfert();
    => CA, c'est plutôt ÉTRANGE ! et incohérent :
    car $table EST RÉCUPÉRÉE DANS transfert() !!!

    => mets à plusieurs endroit de ton code des :
    Code : Sélectionner tout - Visualiser dans une fenêtre à part
    echo '$table = '.$table.'<br />';
    Tu verras à quel moment elle est remplie ou vide...

    => Quel est l’intérêt de la function transfert() ? (qui ne sert qu'une fois)
    Les instructions pourraient être mise directement dans le code.
    Dernière modification par Invité ; 09/05/2012 à 08h46.

  13. #13
    Membre à l'essai
    Homme Profil pro
    Inscrit en
    Janvier 2012
    Messages
    29
    Détails du profil
    Informations personnelles :
    Sexe : Homme

    Informations forums :
    Inscription : Janvier 2012
    Messages : 29
    Points : 15
    Points
    15
    Par défaut
    merci a tous le monde j'ai réécrire le code a nouveau

+ Répondre à la discussion
Cette discussion est résolue.

Discussions similaires

  1. [MySQL] Aide dans un code PHP
    Par mounad dans le forum PHP & Base de données
    Réponses: 2
    Dernier message: 16/01/2012, 00h17
  2. [MySQL] Aide pour un code PHP/MySQL
    Par sara21 dans le forum PHP & Base de données
    Réponses: 1
    Dernier message: 09/04/2010, 08h36
  3. Erreur dans mon code PHP
    Par jack_1981 dans le forum Langage
    Réponses: 6
    Dernier message: 12/05/2006, 10h01
  4. [PHP-JS] Probleme de javascript dans un code php
    Par stomerfull dans le forum Langage
    Réponses: 3
    Dernier message: 23/01/2006, 09h33
  5. [PHP-JS] Probleme de javascript dans un code php
    Par stomerfull dans le forum Langage
    Réponses: 20
    Dernier message: 12/01/2006, 13h41

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