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 :

aide pour trouver mon erreur


Sujet :

Langage PHP

  1. #1
    Membre du Club Avatar de pierre987321
    Inscrit en
    Août 2005
    Messages
    139
    Détails du profil
    Informations forums :
    Inscription : Août 2005
    Messages : 139
    Points : 62
    Points
    62
    Par défaut aide pour trouver mon erreur
    bonjour suite à la réalisation d'un scripte, j'ai une erreur que je n'arrive pas a résoudre.

    Voici déjà le code :
    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
     
    $info = trim(@$_GET['informations']);
    $info = str_replace(", ", " ", $info); 
    $info = str_replace(",", " ", $info); 
    $info = str_replace("; ", " ", $info);
    $info = str_replace(";", " ", $info);
    $info = str_replace("+", " ", $info); 
    $info = str_replace("\"", " ", $info);
    $info = str_replace(":", " ", $info);
    $tablo=explode(" " , $info);
     
     
    echo '<div id="nb_chambresListe" class="dropdown"><ul class="checklist">';
     
    echo '<li class="alt1"><label for="dep"><input type="checkbox" name="france" id="france1" title="France" value="" checked/>Toute la France</label></li>';
     
     
     
    /* Alsace */  
     if ($tablo[0] == '67' || $tablo[1] == '67' || $tablo[2] == '67' || $tablo[3] == '67' || $tablo[4] == '67' || $tablo[5] == '67' || $tablo[6] == '67' || $tablo[7] == '67' || $tablo[8] == '67' || $tablo[9] == '67' || $tablo[10] == '67' || $tablo[11] == '67'  || $tablo[0] == '68' || $tablo[1] == '68' || $tablo[2] == '68' || $tablo[3] == '68' || $tablo[4] == '68' || $tablo[5] == '68' || $tablo[6] == '68' || $tablo[7] == '68' || $tablo[8] == '68' || $tablo[9] == '68' || $tablo[10] == '68' || $tablo[11] == '68' || $_GET['informations'] == "") { 
     
    echo '<li class="selectcategorie"><label for="reg"><input type="checkbox" name="reg"  id="reg1" title="67,68" />ALSACE</label></li>';
     
    echo '<li class="alt1"><label for="dep"><input type="checkbox" name="dep"  id="dep67" title="67" value="67"';
    if ($tablo[0] == '67' || $tablo[1] == '67' || $tablo[2] == '67' || $tablo[3] == '67' || $tablo[4] == '67' || $tablo[5] == '67' || $tablo[6] == '67' || $tablo[7] == '67' || $tablo[8] == '67' || $tablo[9] == '67' || $tablo[10] == '67' || $tablo[11] == '67'){
    echo 'checked';} echo '/>67 - Bas Rhin</label></li>';
     
    echo '<li class="alt1"><label for="dep"><input type="checkbox" name="dep"  id="dep68" title="68" value="68"';
    if ($tablo[0] == '68' || $tablo[1] == '68' || $tablo[2] == '68' || $tablo[3] == '68' || $tablo[4] == '68' || $tablo[5] == '68' || $tablo[6] == '68' || $tablo[7] == '68' || $tablo[8] == '68' || $tablo[9] == '68' || $tablo[10] == '68' || $tablo[11] == '68'){
    echo 'checked';} echo '/>68 - Haut Rhin</label></li>'; 
    }
    /* Alsace */
     
     
     
    /* Aquitaine */
    if ($tablo[0] == '24' || $tablo[1] == '24' || $tablo[2] == '24' || $tablo[3] == '24' || $tablo[4] == '24' || $tablo[5] == '24' || $tablo[6] == '24' || $tablo[7] == '24' || $tablo[8] == '24' || $tablo[9] == '24' || $tablo[10] == '24' || $tablo[11] == '24' || $tablo[0] == '33' || $tablo[1] == '33' || $tablo[2] == '33' || $tablo[3] == '33' || $tablo[4] == '33' || $tablo[5] == '33' || $tablo[6] == '33' || $tablo[7] == '33' || $tablo[8] == '33' || $tablo[9] == '33' || $tablo[10] == '33' || $tablo[11] == '33' || $tablo[0] == '40' || $tablo[1] == '40' || $tablo[2] == '40' || $tablo[3] == '40' || $tablo[4] == '40' || $tablo[5] == '40' || $tablo[6] == '40' || $tablo[7] == '40' || $tablo[8] == '40' || $tablo[9] == '40' || $tablo[10] == '40' || $tablo[11] == '40' || $tablo[0] == '47' || $tablo[1] == '47' || $tablo[2] == '47' || $tablo[3] == '47' || $tablo[4] == '47' || $tablo[5] == '47' || $tablo[6] == '47' || $tablo[7] == '47' || $tablo[8] == '47' || $tablo[9] == '47' || $tablo[10] == '47' || $tablo[11] == '47' || $tablo[0] == '64' || $tablo[1] == '64' || $tablo[2] == '64' || $tablo[3] == '64' || $tablo[4] == '64' || $tablo[5] == '64' || $tablo[6] == '64' || $tablo[7] == '64' || $tablo[8] == '64' || $tablo[9] == '64' || $tablo[10] == '64' || $tablo[11] == '64' || $_GET['informations'] == "" ) { 
     
    echo '<li class="selectcategorie"><label for="reg"><input type="checkbox" name="reg"  id="reg2" title="24,33,40,47,64" />AQUITAINE</label></li>';
     
    echo '<li class="alt1"><label for="dep"><input type="checkbox" name="dep"  id="dep24" title="24" value="24"';
    if ($tablo[0] == '24' || $tablo[1] == '24' || $tablo[2] == '24' || $tablo[3] == '24' || $tablo[4] == '24' || $tablo[5] == '24' || $tablo[6] == '24' || $tablo[7] == '24' || $tablo[8] == '24' || $tablo[9] == '24' || $tablo[10] == '24' || $tablo[11] == '24'){
    echo 'checked';} echo '/>24 - Dordogne</label></li>';
     
    echo '<li class="alt1"><label for="dep"><input type="checkbox" name="dep"  id="dep33" title="33" value="33"'; 
    if ($tablo[0] == '33' || $tablo[1] == '33' || $tablo[2] == '33' || $tablo[3] == '33' || $tablo[4] == '33' || $tablo[5] == '33' || $tablo[6] == '33' || $tablo[7] == '33' || $tablo[8] == '33' || $tablo[9] == '33' || $tablo[10] == '33' || $tablo[11] == '33'){
    echo 'checked';} echo '/>33 - Gironde</label></li>';
     
    echo '<li class="alt1"><label for="dep"><input type="checkbox" name="dep"  id="dep40" title="40" value="40"';
    if ($tablo[0] == '40' || $tablo[1] == '40' || $tablo[2] == '40' || $tablo[3] == '40' || $tablo[4] == '40' || $tablo[5] == '40' || $tablo[6] == '40' || $tablo[7] == '40' || $tablo[8] == '40' || $tablo[9] == '40' || $tablo[10] == '40' || $tablo[11] == '40'){ 
    echo 'checked';} echo '/>40 - Landes</label></li>';
     
    echo '<li class="alt1"><label for="dep"><input type="checkbox" name="dep"  id="dep47" title="47" value="47"'; 
    if ($tablo[0] == '47' || $tablo[1] == '47' || $tablo[2] == '47' || $tablo[3] == '47' || $tablo[4] == '47' || $tablo[5] == '47' || $tablo[6] == '47' || $tablo[7] == '47' || $tablo[8] == '47' || $tablo[9] == '47' || $tablo[10] == '47' || $tablo[11] == '47'){
    echo 'checked';} echo '/>47 - Lot Et Garonne</label></li>';
     
    echo '<li class="alt1"><label for="dep"><input type="checkbox" name="dep"  id="dep64" title="64" value="64"'; 
    if ($tablo[0] == '64' || $tablo[1] == '64' || $tablo[2] == '64' || $tablo[3] == '64' || $tablo[4] == '64' || $tablo[5] == '64' || $tablo[6] == '64' || $tablo[7] == '64' || $tablo[8] == '64' || $tablo[9] == '64' || $tablo[10] == '64' || $tablo[11] == '64'){
    echo 'checked';} echo '/>64 - Pyrenees Atlantiques</label></li>'; }
    /* Aquitaine */
     
     
     
     
    if (in_array(03, $tablo) || in_array(15, $tablo) || in_array(43, $tablo) || in_array(63, $tablo) || $_GET['informations'] == "" ) { 
     
    echo '<li class="selectcategorie"><label for="reg"><input type="checkbox" name="reg"  id="reg3" title="03,15,43,63"/>AUVERGNE</label></li>';
     
    echo '<li class="alt1"><label for="dep"><input type="checkbox" name="dep"  id="dep03" title="03" value="03"';
    if (in_array(03, $tablo)) {
    echo 'checked';} echo '/>03 - Allier</label></li>';
     
    echo '<li class="alt1"><label for="dep"><input type="checkbox" name="dep"  id="dep15" title="15" value="15"';
    if (in_array(15, $tablo)) {
    echo 'checked';} echo '/>15 - Cantal</label></li>';
     
    echo '<li class="alt1"><label for="dep"><input type="checkbox" name="dep"  id="dep43" title="43" value="43"';
    if (in_array(43, $tablo)) {
    echo 'checked';} echo '/>43 - Haute Loire</label></li>';
     
    echo '<li class="alt1"><label for="dep"><input type="checkbox" name="dep"  id="dep63" title="63" value="63"';
    if (in_array(63, $tablo)) {
    echo 'checked';} echo '/>63 - Puy De Dome</label></li>'; }
     
     
     
     
     
    if (in_array(14, $tablo) || in_array(50, $tablo) || in_array(61, $tablo) || $_GET['informations'] == "" ) { 
     
    echo '<li class="selectcategorie"><label for="reg"><input type="checkbox" name="reg"  id="reg4" title="14,50,61"/>Basse-NORMANDIE</label></li>';
     
    echo '<li class="alt1"><label for="dep"><input type="checkbox" name="dep"  id="dep14" title="14" value="14"';
    if (in_array(14, $tablo)) {
    echo 'checked';} echo '/>14 - Calvados</label></li>';
     
    echo '<li class="alt1"><label for="dep"><input type="checkbox" name="dep"  id="dep50" title="50" value="50"';
    if (in_array(50, $tablo)) {
    echo 'checked';} echo '/>50 - Manche</label></li>';
     
    echo '<li class="alt1"><label for="dep"><input type="checkbox" name="dep"  id="dep62" title="61" value="61"';
    if (in_array(61, $tablo)) {
    echo 'checked';} echo '/>61 - Orne</label></li>'; }
     
     
     
     
    if (in_array(21, $tablo) || in_array(58, $tablo) || in_array(71, $tablo) || in_array(89, $tablo) || $_GET['informations'] == "" ) { 
     
    echo '<li class="selectcategorie"><label for="reg"><input type="checkbox" name="reg"  id="reg5" title="21,58,71,89" />BOURGOGNE</label></li>';
     
    echo '<li class="alt1"><label for="dep"><input type="checkbox" name="dep"  id="dep21" title="21" value="21"';
    if (in_array(21, $tablo)) {
    echo 'checked';} echo '/>21 - Cote D or</label></li>';
     
    echo '<li class="alt1"><label for="dep"><input type="checkbox" name="dep"  id="dep58" title="58" value="58"';
    if (in_array(58, $tablo)) {
    echo 'checked';} echo '/>58 - Nievre</label></li>';
     
    echo '<li class="alt1"><label for="dep"><input type="checkbox" name="dep"  id="dep71" title="71" value="71"';
    if (in_array(71, $tablo)) {
    echo 'checked';} echo '/>71 - Saone Et Loire</label></li>';
     
    echo '<li class="alt1"><label for="dep"><input type="checkbox" name="dep"  id="dep89" title="89" value="89"';
    if (in_array(89, $tablo)) {
    echo 'checked';} echo '/>89 - Yonne</label></li>'; }
     
     
     
     
     
    if (in_array(22, $tablo) || in_array(29, $tablo) || in_array(35, $tablo) || in_array(56, $tablo) || $_GET['informations'] == "" ) { 
     
    echo '<li class="selectcategorie"><label for="reg"><input type="checkbox" name="reg"  id="reg6" title="22,29,35,56" />BRETAGNE</label></li>';
     
    echo '<li class="alt1"><label for="dep"><input type="checkbox" name="dep"  id="dep22" title="22" value="22"';
    if (in_array(22, $tablo)) {
    echo 'checked';} echo '/>22 - Cotes D armor</label></li>';
     
    echo '<li class="alt1"><label for="dep"><input type="checkbox" name="dep"  id="dep29" title="29" value="29"';
    if (in_array(29, $tablo)) {
    echo 'checked';} echo '/>29 - Finistere</label></li>';
     
    echo '<li class="alt1"><label for="dep"><input type="checkbox" name="dep"  id="dep35" title="35" value="35"';
    if (in_array(35, $tablo)) {
    echo 'checked';} echo '/>35 - Ille Et Vilaine</label></li>';
     
    echo '<li class="alt1"><label for="dep"><input type="checkbox" name="dep"  id="dep56" title="56" value="56"';
    if (in_array(56, $tablo)) {
    echo 'checked';} echo '/>56 - Morbihan</label></li>'; }
     
     
     
     
     
    if (in_array(18, $tablo) || in_array(28, $tablo) || in_array(36, $tablo) || in_array(37, $tablo) || in_array(41, $tablo) || in_array(45, $tablo) || $_GET['informations'] == "" ) { 
     
    echo '<li class="selectcategorie"><label for="reg"><input type="checkbox" name="reg"  id="reg7" title="18,28,36,37,41,45" />CENTRE</label></li>';
     
    echo '<li class="alt1"><label for="dep"><input type="checkbox" name="dep"  id="dep18" title="18" value="18"';
    if (in_array(18, $tablo)) {
    echo 'checked';} echo '/>18 - Cher</label></li>';
     
    echo '<li class="alt1"><label for="dep"><input type="checkbox" name="dep"  id="dep28" title="28" value="28"';
    if (in_array(28, $tablo)) {
    echo 'checked';} echo '/>28 - Eure Et Loir</label></li>';
     
    echo '<li class="alt1"><label for="dep"><input type="checkbox" name="dep"  id="dep36" title="36" value="36"';
    if (in_array(36, $tablo)) {
    echo 'checked';} echo '/>36 - Indre</label></li>';
     
    echo '<li class="alt1"><label for="dep"><input type="checkbox" name="dep"  id="dep37" title="37" value="37"';
    if (in_array(37, $tablo)) {
    echo 'checked';} echo '/>37 - Indre Et Loire</label></li>';
     
    echo '<li class="alt1"><label for="dep"><input type="checkbox" name="dep"  id="dep41" title="41" value="41"';
    if (in_array(41, $tablo)) {
    echo 'checked';} echo '/>41 - Loir Et Cher</label></li>';
     
    echo '<li class="alt1"><label for="dep"><input type="checkbox" name="dep"  id="dep45" title="45" value="45"';
    if (in_array(45, $tablo)) {
    echo 'checked';} echo '/>45 - Loiret</label></li>'; }
     
     
     
     
     
    if (in_array(08, $tablo) || in_array(10, $tablo) || in_array(51, $tablo) || in_array(52, $tablo) || $_GET['informations'] == "" ) { 
     
    echo '<li class="selectcategorie"><label for="reg"><input type="checkbox" name="reg"  id="reg8" title="08,10,51,52" />CHAMPAGNE-ARDENNE</label></li>';
     
    echo '<li class="alt1"><label for="dep"><input type="checkbox" name="dep"  id="dep08" title="08" value="08"';
    if (in_array(08, $tablo)) {
    echo 'checked';} echo '/>08 - Ardennes</label></li>';
     
    echo '<li class="alt1"><label for="dep"><input type="checkbox" name="dep"  id="dep10" title="10" value="10"';
    if (in_array(10, $tablo)) {
    echo 'checked';} echo '/>10 - Aube</label></li>';
     
    echo '<li class="alt1"><label for="dep"><input type="checkbox" name="dep"  id="dep51" title="51" value="51"';
    if (in_array(51, $tablo)) {
    echo 'checked';} echo '/>51 - Marne</label></li>';
     
    echo '<li class="alt1"><label for="dep"><input type="checkbox" name="dep"  id="dep52" title="52" value="52"';
    if (in_array(52, $tablo)) {
    echo 'checked';} echo '/>52 - Haute Marne</label></li>'; }
     
     
     
     
     
    if (in_array(20, $tablo) || $_GET['informations'] == "" ) { 
     
    echo '<li class="selectcategorie"><label for="reg"><input type="checkbox" name="reg"  id="reg9" title="20" />CORSE</label></li>';
     
    echo '<li class="alt1"><label for="dep"><input type="checkbox" name="dep"  id="dep2a" title="20" value="20"';
    if (in_array(20, $tablo)) {
    echo 'checked';} echo '/>20 - Corse</label></li>'; }
     
     
     
     
     
    if (in_array(25, $tablo) || in_array(39, $tablo) || in_array(70, $tablo) || in_array(90, $tablo) || $_GET['informations'] == "" ) { 
     
    echo '<li class="selectcategorie"><label for="reg"><input type="checkbox" name="reg"  id="reg10" title="25,39,70,90" />FRANCHE-COMTE</label></li>';
     
    echo '<li class="alt1"><label for="dep"><input type="checkbox" name="dep"  id="dep25" title="25" value="25"';
    if (in_array(25, $tablo)) {
    echo 'checked';} echo '/>25 - Doubs</label></li>';
     
    echo '<li class="alt1"><label for="dep"><input type="checkbox" name="dep"  id="dep39" title="39" value="39"';
    if (in_array(39, $tablo)) {
    echo 'checked';} echo '/>39 - Jura</label></li>';
     
    echo '<li class="alt1"><label for="dep"><input type="checkbox" name="dep"  id="dep70" title="70" value="70"';
    if (in_array(70, $tablo)) {
    echo 'checked';} echo '/>70 - Haute Saone</label></li>';
     
    echo '<li class="alt1"><label for="dep"><input type="checkbox" name="dep"  id="dep90" title="90" value="90"';
    if (in_array(90, $tablo)) {
    echo 'checked';} echo '/>90 - Territoire De Belfort</label></li>'; }
     
     
     
     
     
     
    if (in_array(27, $tablo) || in_array(76, $tablo) || $_GET['informations'] == "" ) { 
     
    echo '<li class="selectcategorie"><label for="reg"><input type="checkbox" name="reg"  id="reg11" title="27,76" />Haute-NORMANDIE</label></li>';
     
    echo '<li class="alt1"><label for="dep"><input type="checkbox" name="dep"  id="dep27" title="27" value="27"';
    if (in_array(27, $tablo)) {
    echo 'checked';} echo '/>27 - Eure</label></li>';
     
    echo '<li class="alt1"><label for="dep"><input type="checkbox" name="dep"  id="dep76" title="76" value="76"';
    if (in_array(76, $tablo)) {
    echo 'checked';} echo '/>76 - Seine Maritime</label></li>'; }
     
     
     
     
     
     
    if (in_array(75, $tablo) || in_array(77, $tablo) || in_array(78, $tablo) || in_array(91, $tablo) || in_array(92, $tablo) || in_array(93, $tablo) || in_array(94, $tablo) || in_array(95, $tablo) || $_GET['informations'] == "" ) { 
     
    echo '<li class="selectcategorie"><label for="reg"><input type="checkbox" name="reg"  id="reg12" title="75,77,78,91,92,93,94,95" />ILE-DE-FRANCE</label></li>';
     
    echo '<li class="alt1"><label for="dep"><input type="checkbox" name="dep"  id="dep75" title="75" value="75"';
    if (in_array(75, $tablo)) {
    echo 'checked';} echo '/>75 - Paris</label></li>';
     
    echo '<li class="alt1"><label for="dep"><input type="checkbox" name="dep"  id="dep77" title="77" value="77"';
    if (in_array(77, $tablo)) {
    echo 'checked';} echo '/>77 - Seine Et Marne</label></li>';
     
    echo '<li class="alt1"><label for="dep"><input type="checkbox" name="dep"  id="dep78" title="78" value="78"';
    if (in_array(78, $tablo)) {
    echo 'checked';} echo '/>78 - Yvelines</label></li>';
     
    echo '<li class="alt1"><label for="dep"><input type="checkbox" name="dep"  id="dep91" title="91" value="91"';
    if (in_array(91, $tablo)) {
    echo 'checked';} echo '/>91 - Essonne</label></li>';
     
    echo '<li class="alt1"><label for="dep"><input type="checkbox" name="dep"  id="dep92" title="92" value="92"';
    if (in_array(92, $tablo)) {
    echo 'checked';} echo '/>92 - Hauts De Seine</label></li>';
     
    echo '<li class="alt1"><label for="dep"><input type="checkbox" name="dep"  id="dep93" title="93" value="93"';
    if (in_array(93, $tablo)) {
    echo 'checked';} echo '/>93 - Seine Saint Denis</label></li>';
     
    echo '<li class="alt1"><label for="dep"><input type="checkbox" name="dep"  id="dep94" title="94" value="94"';
    if (in_array(94, $tablo)) {
    echo 'checked';} echo '/>94 - Val De Marne</label></li>';
     
    echo '<li class="alt1"><label for="dep"><input type="checkbox" name="dep"  id="dep95" title="95" value="95"';
    if (in_array(95, $tablo)) {
    echo 'checked';} echo '/>95 - Val D oise</label></li>'; }
     
     
     
     
     
     
    if (in_array(11, $tablo) || in_array(30, $tablo) || in_array(34, $tablo) || in_array(48, $tablo) || in_array(66, $tablo) || $_GET['informations'] == "" ) { 
     
    echo '<li class="selectcategorie"><label for="reg"><input type="checkbox" name="reg"  id="reg13" title="11,30,34,48,66" />LANGUEDOC-ROUSSILLON</label></li>';
     
    echo '<li class="alt1"><label for="dep"><input type="checkbox" name="dep"  id="dep11" title="11" value="11"';
    if (in_array(11, $tablo)) {
    echo 'checked';} echo '/>11 - Aude</label></li>';
     
    echo '<li class="alt1"><label for="dep"><input type="checkbox" name="dep"  id="dep30" title="30" value="30"';
    if (in_array(30, $tablo)) {
    echo 'checked';} echo '/>30 - Gard</label></li>';
     
    echo '<li class="alt1"><label for="dep"><input type="checkbox" name="dep"  id="dep34" title="34" value="34"';
    if (in_array(34, $tablo)) {
    echo 'checked';} echo '/>34 - Herault</label></li>';
     
    echo '<li class="alt1"><label for="dep"><input type="checkbox" name="dep"  id="dep48" title="48" value="48"';
    if (in_array(48, $tablo)) {
    echo 'checked';} echo '/>48 - Lozere</label></li>';
     
    echo '<li class="alt1"><label for="dep"><input type="checkbox" name="dep"  id="dep66" title="66" value="66"';
    if (in_array(66, $tablo)) {
    echo 'checked';} echo '/>66 - Pyrenees Orientales</label></li>'; }
     
     
     
     
     
     
    if (in_array(19, $tablo) || in_array(23, $tablo) || in_array(87, $tablo) || $_GET['informations'] == "" ) { 
     
    echo '<li class="selectcategorie"><label for="reg"><input type="checkbox" name="reg"  id="reg14" title="19,23,87" />LIMOUSIN</label></li>';
     
    echo '<li class="alt1"><label for="dep"><input type="checkbox" name="dep"  id="dep19" title="19" value="19"';
    if (in_array(19, $tablo)) {
    echo 'checked';} echo '/>19 - Correze</label></li>';
     
    echo '<li class="alt1"><label for="dep"><input type="checkbox" name="dep"  id="dep23" title="23" value="23"';
    if (in_array(23, $tablo)) {
    echo 'checked';} echo '/>23 - Creuse</label></li>';
     
    echo '<li class="alt1"><label for="dep"><input type="checkbox" name="dep"  id="dep87" title="87" value="87"';
    if (in_array(87, $tablo)) {
    echo 'checked';} echo '/>87 - Haute Vienne</label></li>'; }
     
     
     
     
     
     
    if (in_array(54, $tablo) || in_array(55, $tablo) || in_array(57, $tablo) || in_array(88, $tablo) || $_GET['informations'] == "" ) { 
     
    echo '<li class="selectcategorie"><label for="reg"><input type="checkbox" name="reg"  id="reg15" title="54,55,57,88" />LORRAINE</label></li>';
     
    echo '<li class="alt1"><label for="dep"><input type="checkbox" name="dep"  id="dep54" title="54" value="54"';
    if (in_array(54, $tablo)) {
    echo 'checked';} echo '/>54 - Meurthe Et Moselle</label></li>';
     
    echo '<li class="alt1"><label for="dep"><input type="checkbox" name="dep"  id="dep55" title="55" value="55"';
    if (in_array(55, $tablo)) {
    echo 'checked';} echo '/>55 - Meuse</label></li>';
     
    echo '<li class="alt1"><label for="dep"><input type="checkbox" name="dep"  id="dep57" title="57" value="57"';
    if (in_array(57, $tablo)) {
    echo 'checked';} echo '/>57 - Moselle</label></li>';
     
    echo '<li class="alt1"><label for="dep"><input type="checkbox" name="dep"  id="dep88" title="88" value="88"';
    if (in_array(88, $tablo)) {
    echo 'checked';} echo '/>88 - Vosges</label></li>'; }
     
     
     
     
     
    if (in_array(09, $tablo) || in_array(12, $tablo) || in_array(31, $tablo) || in_array(32, $tablo) || in_array(46, $tablo) || in_array(65, $tablo) || in_array(81, $tablo) || in_array(82, $tablo) || $_GET['informations'] == "" ) { 
     
    echo '<li class="selectcategorie"><label for="reg"><input type="checkbox" name="reg"  id="reg16" title="09,12,31,32,46,65,81,82" />MIDI-PYRENEES</label></li>';
     
    echo '<li class="alt1"><label for="dep"><input type="checkbox" name="dep"  id="dep09" title="09" value="09"';
    if (in_array(09, $tablo)) {
    echo 'checked';} echo '/>09 - Ariege</label></li>';
     
    echo '<li class="alt1"><label for="dep"><input type="checkbox" name="dep"  id="dep12" title="12" value="12"';
    if (in_array(12, $tablo)) {
    echo 'checked';} echo '/>12 - Aveyron</label></li>';
     
    echo '<li class="alt1"><label for="dep"><input type="checkbox" name="dep"  id="dep31" title="31" value="31"';
    if (in_array(31, $tablo)) {
    echo 'checked';} echo '/>31 - Haute Garonne</label></li>';
     
    echo '<li class="alt1"><label for="dep"><input type="checkbox" name="dep"  id="de32p" title="32" value="32"';
    if (in_array(32, $tablo)) {
    echo 'checked';} echo '/>32 - Gers</label></li>';
     
    echo '<li class="alt1"><label for="dep"><input type="checkbox" name="dep"  id="dep46" title="46" value="46"';
    if (in_array(46, $tablo)) {
    echo 'checked';} echo '/>46 - Lot</label></li>';
     
    echo '<li class="alt1"><label for="dep"><input type="checkbox" name="dep"  id="de65p" title="65" value="65"';
    if (in_array(65, $tablo)) {
    echo 'checked';} echo '/>65 - Hautes Pyrenees</label></li>';
     
    echo '<li class="alt1"><label for="dep"><input type="checkbox" name="dep"  id="dep81" title="81" value="81"';
    if (in_array(81, $tablo)) {
    echo 'checked';} echo '/>81 - Tarn</label></li>';
     
    echo '<li class="alt1"><label for="dep"><input type="checkbox" name="dep"  id="dep82" title="82" value="82"';
    if (in_array(82, $tablo)) {
    echo 'checked';} echo '/>82 - Tarn Et Garonne</label></li>'; }
     
     
     
     
     
     
     
    if (in_array(59, $tablo) || in_array(62, $tablo) || $_GET['informations'] == "" ) { 
     
    echo '<li class="selectcategorie"><label for="reg"><input type="checkbox" name="reg"  id="reg17" title="59,62" />NORD-PAS-DE-CALAIS</label></li>';
     
    echo '<li class="alt1"><label for="dep"><input type="checkbox" name="dep"  id="dep59" title="59" value="59"';
    if (in_array(59, $tablo)) {
    echo 'checked';} echo '/>59 - Nord</label></li>';
     
    echo '<li class="alt1"><label for="dep"><input type="checkbox" name="dep"  id="dep62" title="62" value="62"';
    if (in_array(62, $tablo)) {
    echo 'checked';} echo '/>62 - Pas De Calais</label></li>'; }
     
     
     
     
     
     
     
    if (in_array(44, $tablo) || in_array(49, $tablo) || in_array(53, $tablo) || in_array(72, $tablo) || in_array(85, $tablo) || $_GET['informations'] == "" ) { 
     
    echo '<li class="selectcategorie"><label for="reg"><input type="checkbox" name="reg"  id="reg18" title="44,49,53,72,85" />PAYS DE LA LOIRE</label></li>';
     
    echo '<li class="alt1"><label for="dep"><input type="checkbox" name="dep"  id="dep44" title="44" value="44"';
    if (in_array(44, $tablo)) {
    echo 'checked';} echo '/>44 - Loire Atlantique</label></li>';
     
    echo '<li class="alt1"><label for="dep"><input type="checkbox" name="dep"  id="dep49" title="49" value="49"';
    if (in_array(49, $tablo)) {
    echo 'checked';} echo '/>49 - Maine Et Loire</label></li>';
     
    echo '<li class="alt1"><label for="dep"><input type="checkbox" name="dep"  id="dep53" title="53" value="53"';
    if (in_array(53, $tablo)) {
    echo 'checked';} echo '/>53 - Mayenne</label></li>';
     
    echo '<li class="alt1"><label for="dep"><input type="checkbox" name="dep"  id="dep72" title="72" value="72"';
    if (in_array(72, $tablo)) {
    echo 'checked';} echo '/>72 - Sarthe</label></li>';
     
    echo '<li class="alt1"><label for="dep"><input type="checkbox" name="dep"  id="dep85" title="85" value="85"';
    if (in_array(85, $tablo)) {
    echo 'checked';} echo '/>85 - Vendee</label></li>'; }
     
     
     
     
     
     
    if (in_array(02, $tablo) || in_array(60, $tablo) || in_array(80, $tablo) || $_GET['informations'] == "" ) { 
     
    echo'<li class="selectcategorie"><label for="reg"><input type="checkbox" name="reg"  id="reg19" title="02,60,80" />PICARDIE</label></li>';
     
    echo '<li class="alt1"><label for="dep"><input type="checkbox" name="dep"  id="dep02" title="02" value="02"';
    if (in_array(02, $tablo)) {
    echo 'checked';} echo '/>02 - Aisne</label></li>';
     
    echo '<li class="alt1"><label for="dep"><input type="checkbox" name="dep"  id="dep60" title="60" value="60"';
    if (in_array(60, $tablo)) {
    echo 'checked';} echo '/>60 - Oise</label></li>';
     
    echo '<li class="alt1"><label for="dep"><input type="checkbox" name="dep"  id="dep80" title="80" value="80"';
    if (in_array(80, $tablo)) {
    echo 'checked';} echo '/>80 - Somme</label></li>'; }
     
     
     
     
     
    if (in_array(16, $tablo) || in_array(17, $tablo) || in_array(79, $tablo) || in_array(86, $tablo) || $_GET['informations'] == "" ) { 
     
    echo '<li class="selectcategorie"><label for="reg"><input type="checkbox" name="reg"  id="reg20" title="16,17,79,86" />POITOU-CHARENTES</label></li>';
     
    echo '<li class="alt1"><label for="dep"><input type="checkbox" name="dep"  id="dep16" title="16" value="16"';
    if (in_array(16, $tablo)) {
    echo 'checked';} echo '/>16 - Charente</label></li>';
     
    echo '<li class="alt1"><label for="dep"><input type="checkbox" name="dep"  id="dep17" title="17" value="17"';
    if (in_array(17, $tablo)) {
    echo 'checked';} echo '/>17 - Charente Maritime</label></li>';
     
    echo '<li class="alt1"><label for="dep"><input type="checkbox" name="dep"  id="dep79" title="79" value="79"';
    if (in_array(79, $tablo)) {
    echo 'checked';} echo '/>79 - Deux Sevres</label></li>';
     
    echo '<li class="alt1"><label for="dep"><input type="checkbox" name="dep"  id="dep86" title="86" value="86"';
    if (in_array(86, $tablo)) {
    echo 'checked';} echo '/>86 - Vienne</label></li>'; }
     
     
     
     
     
     
     
     
    if (in_array(04, $tablo) || in_array(05, $tablo) || in_array(06, $tablo) || in_array(13, $tablo) || in_array(83, $tablo) || in_array(84, $tablo) || $_GET['informations'] == "" ) { 
     
    echo '<li class="selectcategorie"><label for="reg"><input type="checkbox" name="reg"  id="reg21" title="04,05,06,13,83,84" />PROVENCE-ALPES-COTE-AZUR</label></li>';
     
    echo '<li class="alt1"><label for="dep"><input type="checkbox" name="dep"  id="dep04" title="04" value="04"';
    if (in_array(04, $tablo)) {
    echo 'checked';} echo '/>04 - Alpes De Haute Provence</label></li>';
     
    echo '<li class="alt1"><label for="dep"><input type="checkbox" name="dep"  id="dep05" title="05" value="05"';
    if (in_array(05, $tablo)) {
    echo 'checked';} echo '/>05 - Hautes Alpes</label></li>';
     
    echo '<li class="alt1"><label for="dep"><input type="checkbox" name="dep"  id="dep06" title="06" value="06"';
    if (in_array(06, $tablo)) {
    echo 'checked';} echo '/>06 - Alpes Maritimes</label></li>';
     
    echo '<li class="alt1"><label for="dep"><input type="checkbox" name="dep"  id="dep13" title="13" value="13"';
    if (in_array(13, $tablo)) {
    echo 'checked';} echo '/>13 - Bouches Du Rhone</label></li>';
     
    echo '<li class="alt1"><label for="dep"><input type="checkbox" name="dep"  id="dep83" title="83" value="83"';
    if (in_array(83, $tablo)) {
    echo 'checked';} echo '/>83 - Var</label></li>';
     
    echo '<li class="alt1"><label for="dep"><input type="checkbox" name="dep"  id="dep84" title="84" value="84"';
    if (in_array(84, $tablo)) {
    echo 'checked';} echo '/>84 - Vaucluse</label></li>'; }
     
     
     
     
     
     
    if (in_array(01, $tablo) || in_array(07, $tablo) || in_array(26, $tablo) || in_array(38, $tablo) || in_array(42, $tablo) || in_array(69, $tablo) || in_array(73, $tablo) || in_array(74, $tablo) || $_GET['informations'] == "" ) { 
     
    echo '<li class="selectcategorie"><label for="reg"><input type="checkbox" name="reg"  id="reg22" title="01,07,26,38,42,69,73,74" />RHONE-ALPES</label></li>';
     
    echo '<li class="alt1"><label for="dep"><input type="checkbox" name="dep"  id="dep01" title="01" value="01"';
    if (in_array(01, $tablo)) {
    echo 'checked';} echo '/>01 - Ain</label></li>';
     
    echo '<li class="alt1"><label for="dep"><input type="checkbox" name="dep"  id="dep07" title="07" value="07"';
    if (in_array(07, $tablo)) {
    echo 'checked';} echo '/>07 - Ardeche</label></li>';
     
    echo '<li class="alt1"><label for="dep"><input type="checkbox" name="dep"  id="dep26" title="26" value="26"';
    if (in_array(26, $tablo)) {
    echo 'checked';} echo '/>26 - Drome</label></li>';
     
    echo '<li class="alt1"><label for="dep"><input type="checkbox" name="dep"  id="dep38" title="38" value="38"';
    if (in_array(38, $tablo)) {
    echo 'checked';} echo '/>38 - Isere</label></li>';
     
    echo '<li class="alt1"><label for="dep"><input type="checkbox" name="dep"  id="dep42" title="42" value="42"';
    if (in_array(42, $tablo)) {
    echo 'checked';} echo '/>42 - Loire</label></li>';
     
    echo '<li class="alt1"><label for="dep"><input type="checkbox" name="dep"  id="dep69" title="69" value="69"';
    if (in_array(69, $tablo)) {
    echo 'checked';} echo '/>69 - Rhone</label></li>';
     
    echo '<li class="alt1"><label for="dep"><input type="checkbox" name="dep"  id="dep73" title="73" value="73"';
    if (in_array(73, $tablo)) {
    echo 'checked';} echo '/>73 - Savoie</label></li>';
     
    echo '<li class="alt1"><label for="dep"><input type="checkbox" name="dep"  id="dep74" title="74" value="74"';
    if (in_array(74, $tablo)) {
    echo 'checked';} echo '/>74 - Haute Savoie</label></li>'; }                   
     
    echo '</ul></div>';
    Le probleme est que le INPUT 08 et 09 est toujour coché alors qu'il ne doit pas l'etre. sachant que @$_GET['informations'] n'est pas renseigné.



  2. #2
    Expert éminent sénior

    Profil pro
    Inscrit en
    Juin 2002
    Messages
    6 152
    Détails du profil
    Informations personnelles :
    Localisation : France

    Informations forums :
    Inscription : Juin 2002
    Messages : 6 152
    Points : 17 777
    Points
    17 777
    Par défaut
    Un nombre commençant par un zéro est considéré par PHP comme étant en notation octale et non décimale. Dès lors, 08 et 09 étant invalides, PHP les transforme silencieusement en 0.

    Citation Envoyé par documentation
    Pour utiliser la notation octale, précédez le nombre d'un 0 (zéro).
    Citation Envoyé par documentation
    Si un nombre invalide est fourni dans un entier octal (i.e. 8 ou 9), le reste du nombre est ignoré.
    Ensuite, étant donné que $_GET['informations'] n'existe pas, explode(' ', $_GET['informations']) renvoie un tableau d'un élément : une chaîne vide. Le test de ces nombres octaux invalides (donc 0) avec une comparaison non stricte des éléments de ce tableau (la chaîne vide), aboutiront à une valeur vraie (puisque pour PHP 0 == '').

    Ce code aurait bien besoin d'une réécriture, à commencer par :
    Code : Sélectionner tout - Visualiser dans une fenêtre à part
    1
    2
    3
    4
    5
    6
    7
    if (isset($_GET['informations'])) {
        $info = trim($_GET['informations']);
        $info = str_replace(array(', ', ',', '; ', ';', '+', '"', ':'), ' ', $info);
        $tablo = explode(' ', $info);
    } else {
        $tablo = array();
    }
    En plus des 08/09 à corriger.

  3. #3
    Membre du Club Avatar de pierre987321
    Inscrit en
    Août 2005
    Messages
    139
    Détails du profil
    Informations forums :
    Inscription : Août 2005
    Messages : 139
    Points : 62
    Points
    62
    Par défaut .
    Pour quel raison sa ne fait pas pour les autres ?
    les 01,02,03,04,05,06,07 ?

    il y à que pour 08 et 09


    Je suis perdu

  4. #4
    Membre émérite Avatar de Djakisback
    Profil pro
    Inscrit en
    Février 2005
    Messages
    2 023
    Détails du profil
    Informations personnelles :
    Localisation : France

    Informations forums :
    Inscription : Février 2005
    Messages : 2 023
    Points : 2 273
    Points
    2 273
    Par défaut
    Salut, donc apparemment le code incriminé est celui-là ?


    Code : Sélectionner tout - Visualiser dans une fenêtre à part
    1
    2
    3
    4
    5
    6
    7
    if (in_array(08, $tablo) || in_array(10, $tablo) || in_array(51, $tablo) || in_array(52, $tablo) || $_GET['informations'] == "" ) { 
     
    echo '<li class="selectcategorie"><label for="reg"><input type="checkbox" name="reg"  id="reg8" title="08,10,51,52" />CHAMPAGNE-ARDENNE</label></li>';
     
    echo '<li class="alt1"><label for="dep"><input type="checkbox" name="dep"  id="dep08" title="08" value="08"';
    if (in_array(08, $tablo)) {
    echo 'checked';} echo '/>08 - Ardennes</label></li>';
    Ajoute un var_dump($tablo) et var_dump($_GET['inormations']) pour voir ce que tes variables contiennent et si ce test "if (in_array(08, $tablo))" retourne bien true. Au passage, tu aurais sans doute pu faire beaucoup plus simple et plus propre pour ton code En définissant des tableaux et en les parcourant pour l'affichage des inputs.

  5. #5
    Membre éprouvé

    Profil pro
    Inscrit en
    Juin 2007
    Messages
    748
    Détails du profil
    Informations personnelles :
    Localisation : France

    Informations forums :
    Inscription : Juin 2007
    Messages : 748
    Points : 1 022
    Points
    1 022
    Par défaut $string ; CONSTANTE
    essai juste de définir les valeurs comme des variable string, avec des cot, "09" :
    Code : Sélectionner tout - Visualiser dans une fenêtre à part
    if (in_array("09", $tablo)
    ,

  6. #6
    Membre du Club Avatar de pierre987321
    Inscrit en
    Août 2005
    Messages
    139
    Détails du profil
    Informations forums :
    Inscription : Août 2005
    Messages : 139
    Points : 62
    Points
    62
    Par défaut ...
    Merci ascito, sa marche bien simplement comme des variable string, avec des cot, "09".

    Merci a toi et sur tout a vous...


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

Discussions similaires

  1. Besoin d'aide pour comprendre Mon erreur
    Par napi15 dans le forum ASP.NET
    Réponses: 1
    Dernier message: 24/04/2013, 22h10
  2. Réponses: 6
    Dernier message: 05/11/2009, 11h47
  3. Besoin d'aide pour trouver un SGBD SVP
    Par rateub dans le forum Décisions SGBD
    Réponses: 2
    Dernier message: 26/01/2005, 20h20

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