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 :

Problème conversion myysql a mysqli


Sujet :

Langage PHP

  1. #1
    Candidat au Club
    Homme Profil pro
    Architecte réseau
    Inscrit en
    Mars 2017
    Messages
    10
    Détails du profil
    Informations personnelles :
    Sexe : Homme
    Âge : 40
    Localisation : Canada

    Informations professionnelles :
    Activité : Architecte réseau

    Informations forums :
    Inscription : Mars 2017
    Messages : 10
    Points : 4
    Points
    4
    Par défaut Problème conversion myysql a mysqli
    Question du jour

    J'aimerais savoir si certain d'entre vous aurait pu avoir le même problème que j'ai et ne trouve pas de solution

    avant que je passe a mysqli tout fonctionnais pour le mieux la facon donc je fonctionnais ces que je me logait et une page de bienvenue ouvrait et une fenetre popup m'envoyais a ma page home.php mais la depuis la conversion ma page qui devrais être home reviens toujours a ma page de login. elle n'arrive pas a passer a la page home.php et pourtant la seul choses que j'ai changer ces de mysql a mysqli

    Est ce que ca peux provenir de ma commande exemple

    Auparavant:

    $UserStatus = mysql_result($getUserAccountStatusResult,0,"status.statusName");

    maintenant:

    $UserStatus = mysqli_fetch_row($getUserAccountStatusResult,0,"status.statusName");

  2. #2
    Expert éminent sénior
    Avatar de mathieu
    Profil pro
    Inscrit en
    Juin 2003
    Messages
    10 356
    Détails du profil
    Informations personnelles :
    Localisation : France

    Informations forums :
    Inscription : Juin 2003
    Messages : 10 356
    Points : 15 702
    Points
    15 702
    Par défaut
    montrez nous le code que vous avez modifié et qui a produit ce problème

  3. #3
    Candidat au Club
    Homme Profil pro
    Architecte réseau
    Inscrit en
    Mars 2017
    Messages
    10
    Détails du profil
    Informations personnelles :
    Sexe : Homme
    Âge : 40
    Localisation : Canada

    Informations professionnelles :
    Activité : Architecte réseau

    Informations forums :
    Inscription : Mars 2017
    Messages : 10
    Points : 4
    Points
    4
    Par défaut
    Bien ca peux provenir de plusieurs fichier qui va faire l'authentification !!! Puis-je mettre plusieurs fichier ici sur le forum ??


    index.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
    <?php
    	header("Expires: Thu, 17 May 2001 10:17:17 GMT");    // Date in the past
    	header ("Last-Modified: " . gmdate("D, d M Y H:i:s") . " GMT"); // always modified
    	header ("Cache-Control: no-cache, must-revalidate");  // HTTP/1.1
    	header ("Pragma: no-cache");                          // HTTP/1.0
     
    	session_start();
     
    	if (!isset($_SESSION['SESSION'])) require ( "session_init.php");
    	require_once("DB_CONNECT.php");
     
    	if ($_SESSION['LOGGEDIN'] != true) 
    	{
    		header("Location: index.php");
    		exit;
    	}
    	else if ($_SESSION['LOGGEDIN'] == true && $_SESSION['LOGIN_TYPE'] != "client")
    	{	
    		$UserID = $_SESSION['LOGED_USERID'];
    		$getUserAccountStatusSQL = "SELECT status.statusName FROM user INNER JOIN status ON user.statusID = status.statusID WHERE user.userID = '$UserID'";
    		$getUserAccountStatusResult = mysqli_query($con,$getUserAccountStatusSQL) or die ('Query[getUserAccountStatusSQL] failed: ' . mysqli_error($con));
     
    		$UserStatus = mysqli_fetch_row($getUserAccountStatusResult,0,"status.statusName");
     
    		if($UserStatus != 'Actif')
    		{
    			header("Location: index.php");
    			exit;
    		}
    	}
    	elseif ($_SESSION['LOGGEDIN'] == true && $_SESSION['LOGIN_TYPE'] == "client")
    	{
    		$ClientUserID = $_SESSION['LOGED_USERID'];
    		$getClientUserAccountStatusSQL = "SELECT status.statusName FROM client_user INNER JOIN status ON client_user.statusID = status.statusID WHERE client_user.clientUserID = '$ClientUserID'";
    		$getClientUserAccountStatusResult = mysqli_query($con,$getClientUserAccountStatusSQL) or die ('Query[getClientUserAccountStatusSQL] failed: ' . mysqli_error($con));
     
    		$ClientUserStatus = mysqli_fetch_row($getClientUserAccountStatusResult,0,"status.statusName");
     
    		if($ClientUserStatus != 'Actif')
    		{
    			header("Location: index.php");
    			exit;
    		}
    	}	
    ?>
    home.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
    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
    737
    738
    739
    740
    741
    742
    743
    744
    745
    746
    747
    748
    749
    750
    751
    752
    753
    754
    755
    756
    757
    758
    759
    760
    761
    762
    763
    764
    765
    766
    767
    768
    769
    770
    771
    772
    773
    774
    775
    776
    777
    778
    779
    780
    781
    782
    783
    784
    785
    786
    787
    788
    789
    790
    791
    792
    793
    794
    795
    796
    797
    798
    799
    800
    801
    802
    803
    804
    805
    806
    807
    808
    809
    810
    811
    812
    813
    814
    815
    816
    817
    818
    819
    820
    821
    822
    823
    824
    825
    826
    827
    828
    829
    830
    831
    832
    833
    834
    835
    836
    837
    838
    839
    840
    841
    842
    843
    844
    845
    846
    847
    848
    849
    850
    851
    852
    853
    854
    855
    856
    857
    858
    859
    860
    861
    862
    863
    864
    865
    866
    867
    868
    869
    870
    871
    872
    873
    874
    875
    876
    877
    878
    879
    880
    881
    882
    883
    884
    885
    886
    887
    888
    889
    890
    891
    892
    893
    894
    895
    896
    897
    898
    899
    900
    901
    902
    <?php
    	require_once 'scripts/SESSION_CONNECT.php';
    	require_once 'scripts/functions.php';
     
    	$LoginType = "";
    	$refresh = "";
    	$leftMenu = "";
    	$mainPage = "";
    	$defaultPanelIndex = -1;
    	$LogedUserID = $_SESSION['LOGED_USERID'];
    	$LoginType = $_SESSION['LOGIN_TYPE'];
    	$LoginPositionName = $_SESSION['LOGIN_POSITION_NAME'];
    	$FirstLogin = $_SESSION['INITIAL_LOGIN'];
     
    	//Page creation and redirection for a DISPATCHER login and menu updates
    	if (isset($LoginType) && !isset($_GET['mainPage']) && ($LoginType == "dispatch"))
    	{
    		$leftMenu = "sideMenu.php";
    		$mainPage = "dispatchMain.php";
    	}
    	elseif (isset($LoginType) && isset($_GET['mainPage']) && ($LoginType == "dispatch"))
    	{
    		$leftMenu = "sideMenu.php";
    		if ($_GET['mainPage'] == "dispatchMain")
    		{
    			$mainPage = "dispatchMain.php";
    		}
    		elseif ($_GET['mainPage'] == "shiftReportList")
    		{
    			$mainPage = "shiftReportList.php";
    		}
    		elseif ($_GET['mainPage'] == "dailyReport")
    		{
    			$mainPage = "dailyReportForm.php";
    		}
    		elseif ($_GET['mainPage'] == "carAssign")
    		{
    			$mainPage = "carAssign.php";
    		}
    		elseif ($_GET['mainPage'] == "alarmReports")
    		{
    			$mainPage = "alarmReports.php";
    		}
    		elseif ($_GET['mainPage'] == "preventiveReports")
    		{
    			$mainPage = "preventiveReports.php";
    		}
            elseif ($_GET['mainPage'] == "addClient")
    		{
    			$mainPage = "addClient.php";
    		}
    	}
     
    	//Page creation and redirection for a CLIENT login and menu updates
    	if (isset($LoginType) && !isset($_GET['mainPage']) && ($LoginType == "client"))
    	{
    		$leftMenu = "sideMenu.php";
    		$mainPage = "clientMain.php";
    	}
    	elseif (isset($LoginType) && isset($_GET['mainPage']) && ($LoginType == "client"))
    	{
    		$leftMenu = "sideMenu.php";
    		if ($_GET['mainPage'] == "clientMain")
    		{
    			$mainPage = "clientMain.php";
    		}
    		elseif ($_GET['mainPage'] == "alarmReports")
    		{
    			$mainPage = "alarmReports.php";
    		}
    		elseif ($_GET['mainPage'] == "preventiveReports")
    		{
    			$mainPage = "preventiveReports.php";
    		}
    	}
     
    	//Page creation and redirection for a PATROLLER login and menu updates
    	if (isset($LoginType) && !isset($_GET['mainPage']) && ($LoginType == "patrol"))
    	{
    		$leftMenu = "sideMenu.php";
    		$mainPage = "patrolMain.php";
    	}
    	elseif (isset($LoginType) && isset($_GET['mainPage']) && ($LoginType == "patrol"))
    	{
    		$leftMenu = "sideMenu.php";
    		if ($_GET['mainPage'] == "patrolMain")
    		{
    			$mainPage = "patrolMain.php";
    		}
    		elseif ($_GET['mainPage'] == "shiftReportList")
    		{
    			$mainPage = "shiftReportList.php";
    		}
    		elseif ($_GET['mainPage'] == "dailyReport")
    		{
    			$mainPage = "dailyReportForm.php";
    		}
    		elseif ($_GET['mainPage'] == "alarmReports")
    		{
    			$mainPage = "alarmReports.php";
    		}
    		elseif ($_GET['mainPage'] == "preventiveReports")
    		{
    			$mainPage = "preventiveReports.php";
    		}
    		elseif ($_GET['mainPage'] == "patroller")
    		{
    			$mainPage = "patroller.php";
    		}
    	}
     
    	//Page creation and redirection for a ADMINISTRATOR login and menu updates
    	if (isset($LoginType) && !isset($_GET['mainPage']) && ($LoginType == "admin"))
    	{
    		$leftMenu = "sideMenu.php";
    		$mainPage = "dispatchMain.php";
    	}
    	elseif (isset($LoginType) && isset($_GET['mainPage']) && ($LoginType == "admin"))
    	{
    		$leftMenu = "sideMenu.php";
    		if ($_GET['mainPage'] == "dispatchMain")
    		{
    			$mainPage = "dispatchMain.php";
    		}
    		elseif ($_GET['mainPage'] == "addUser")
    		{
    			$mainPage = "addUser.php";
    		}
    		elseif ($_GET['mainPage'] == "addAlarmCo")
    		{
    			$mainPage = "addAlarmCo.php";
    		}
    		elseif ($_GET['mainPage'] == "addClient")
    		{
    			$mainPage = "addClient.php";
    		}
    		elseif ($_GET['mainPage'] == "addSite")
    		{
    			$mainPage = "addSite.php";
    		}
    		elseif ($_GET['mainPage'] == "addCar")
    		{
    			$mainPage = "addCar.php";
    		}
    		elseif ($_GET['mainPage'] == "addDirective")
    		{
    			$mainPage = "addDirective.php";
    		}
    		elseif ($_GET['mainPage'] == "addFiles")
    		{
    			$mainPage = "addFiles.php";
    		}
    		elseif ($_GET['mainPage'] == "addAlarmType")
    		{
    			$mainPage = "addAlarmType.php";
    		}
    		elseif ($_GET['mainPage'] == "carAssign")
    		{
    			$mainPage = "carAssign.php";
    		}
    		elseif ($_GET['mainPage'] == "shiftReportList")
    		{
    			$mainPage = "shiftReportList.php";
    		}
    		elseif ($_GET['mainPage'] == "dailyReport")
    		{
    			$mainPage = "dailyReportForm.php";
    		}
    		elseif ($_GET['mainPage'] == "addTemplate")
    		{
    			$mainPage = "addTemplate.php";
    		}
    		elseif ($_GET['mainPage'] == "alarmReports")
    		{
    			$mainPage = "alarmReports.php";
    		}
    		elseif ($_GET['mainPage'] == "preventiveReports")
    		{
    			$mainPage = "preventiveReports.php";
    		}
    		elseif ($_GET['mainPage'] == "addDepartment")
    		{
    			$mainPage = "addDepartment.php";
    		}
    		elseif ($_GET['mainPage'] == "alarmCallPeak")
    		{
    			$mainPage = "alarmPeakForm.php";
    		}
    		elseif ($_GET['mainPage'] == "scheduleListReport")
    		{
    			$mainPage = "scheduleListReport.php";
    		}
    		elseif ($_GET['mainPage'] == "alarmStats")
    		{
    			$mainPage = "alarmStatsForm.php";
    		}
    		elseif ($_GET['mainPage'] == "preventiveStats")
    		{
    			$mainPage = "preventiveStatsForm.php";
    		}
    	}
     
    	//Page creation and redirection for a ROOT login and menu updates
    	if (isset($LoginType) && !isset($_GET['mainPage']) && ($LoginType == "root"))
    	{
    		$leftMenu = "sideMenu.php";
    		$mainPage = "dispatchMain.php";
    	}
    	elseif (isset($LoginType) && isset($_GET['mainPage']) && ($LoginType == "root"))
    	{
    		$leftMenu = "sideMenu.php";
    		if ($_GET['mainPage'] == "dispatchMain")
    		{
    			$mainPage = "dispatchMain.php";
    		}
    		elseif ($_GET['mainPage'] == "addUser")
    		{
    			$mainPage = "addUser.php";
    		}
    		elseif ($_GET['mainPage'] == "addClientUser")
    		{
    			$mainPage = "addClientUser.php";
    		}
    		elseif ($_GET['mainPage'] == "addAlarmCo")
    		{
    			$mainPage = "addAlarmCo.php";
    		}
    		elseif ($_GET['mainPage'] == "addClient")
    		{
    			$mainPage = "addClient.php";
    		}
    		elseif ($_GET['mainPage'] == "addSite")
    		{
    			$mainPage = "addSite.php";
    		}
    		elseif ($_GET['mainPage'] == "addCar")
    		{
    			$mainPage = "addCar.php";
    		}
    		elseif ($_GET['mainPage'] == "addDirective")
    		{
    			$mainPage = "addDirective.php";
    		}
    		elseif ($_GET['mainPage'] == "addFiles")
    		{
    			$mainPage = "addFiles.php";
    		}
    		elseif ($_GET['mainPage'] == "addAlarmType")
    		{
    			$mainPage = "addAlarmType.php";
    		}
    		elseif ($_GET['mainPage'] == "addDepartment")
    		{
    			$mainPage = "addDepartment.php";
    		}
    		elseif ($_GET['mainPage'] == "carAssign")
    		{
    			$mainPage = "carAssign.php";
    		}
    		elseif ($_GET['mainPage'] == "shiftReportList")
    		{
    			$mainPage = "shiftReportList.php";
    		}
    		elseif ($_GET['mainPage'] == "dailyReport")
    		{
    			$mainPage = "dailyReportForm.php";
    		}
    		elseif ($_GET['mainPage'] == "addTemplate")
    		{
    			$mainPage = "addTemplate.php";
    		}
    		elseif ($_GET['mainPage'] == "alarmReports")
    		{
    			$mainPage = "alarmReports.php";
    		}
    		elseif ($_GET['mainPage'] == "preventiveReports")
    		{
    			$mainPage = "preventiveReports.php";
    		}
    		elseif ($_GET['mainPage'] == "alarmCallPeak")
    		{
    			$mainPage = "alarmPeakForm.php";
    		}
    		elseif ($_GET['mainPage'] == "scheduleListReport")
    		{
    			$mainPage = "scheduleListReport.php";
    		}
    		elseif ($_GET['mainPage'] == "alarmStats")
    		{
    			$mainPage = "alarmStatsForm.php";
    		}
    		elseif ($_GET['mainPage'] == "preventiveStats")
    		{
    			$mainPage = "preventiveStatsForm.php";
    		}
    		elseif ($_GET['mainPage'] == "BillingRulesSelection")
    		{
    			$mainPage = "billingRulesSelection.php";
    		}
    		elseif ($_GET['mainPage'] == "createInvoice")
    		{
    			$mainPage = "createInvoice.php";
    		}
            elseif ($_GET['mainPage'] == "findInvoice")
    		{
    			$mainPage = "findInvoice.php";
    		}
    		elseif ($_GET['mainPage'] == "autoSuggest")
    		{
    			$mainPage = "autosuggest/AutoSuggest.html";
    		}
    	}
     
    	//Page creation and redirection for a MANAGERS login and menu updates
    	if (isset($LoginType) && !isset($_GET['mainPage']) && ($LoginType == "manager"))
    	{
    		$leftMenu = "sideMenu.php";
    		$mainPage = "dispatchMain.php";
    	}
    	elseif (isset($LoginType) && isset($_GET['mainPage']) && ($LoginType == "manager"))
    	{
    		$leftMenu = "sideMenu.php";
    		if ($_GET['mainPage'] == "dispatchMain")
    		{
    			$mainPage = "dispatchMain.php";
    		}
    		elseif ($_GET['mainPage'] == "addUser")
    		{
    			$mainPage = "addUser.php";
    		}
    		elseif ($_GET['mainPage'] == "addAlarmCo")
    		{
    			$mainPage = "addAlarmCo.php";
    		}
    		elseif ($_GET['mainPage'] == "addFiles")
    		{
    			$mainPage = "addFiles.php";
    		}
    		elseif ($_GET['mainPage'] == "addClient")
    		{
    			$mainPage = "addClient.php";
    		}
    		elseif ($_GET['mainPage'] == "addSite")
    		{
    			$mainPage = "addSite.php";
    		}
    		elseif ($_GET['mainPage'] == "addCar")
    		{
    			$mainPage = "addCar.php";
    		}
    		elseif ($_GET['mainPage'] == "addDirective")
    		{
    			$mainPage = "addDirective.php";
    		}
    		elseif ($_GET['mainPage'] == "carAssign")
    		{
    			$mainPage = "carAssign.php";
    		}
    		elseif ($_GET['mainPage'] == "addAlarmType")
    		{
    			$mainPage = "addAlarmType.php";
    		}
    		elseif ($_GET['mainPage'] == "shiftReportList")
    		{
    			$mainPage = "shiftReportList.php";
    		}
    		elseif ($_GET['mainPage'] == "dailyReport")
    		{
    			$mainPage = "dailyReportForm.php";
    		}
    		elseif ($_GET['mainPage'] == "addTemplate")
    		{
    			$mainPage = "addTemplate.php";
    		}
    		elseif ($_GET['mainPage'] == "alarmReports")
    		{
    			$mainPage = "alarmReports.php";
    		}
    		elseif ($_GET['mainPage'] == "preventiveReports")
    		{
    			$mainPage = "preventiveReports.php";
    		}
    		elseif ($_GET['mainPage'] == "alarmCallPeak")
    		{
    			$mainPage = "alarmPeakForm.php";
    		}
    		elseif ($_GET['mainPage'] == "preventiveReports")
    		{
    			$mainPage = "preventiveReports.php";
    		}
    		elseif ($_GET['mainPage'] == "alarmStats")
    		{
    			$mainPage = "alarmStatsForm.php";
    		}
    		elseif ($_GET['mainPage'] == "preventiveStats")
    		{
    			$mainPage = "preventiveStatsForm.php";
    		}
    	}
     
    	//Page creation and redirection for a SENIOR DISPATCHER login and menu updates
    	if (isset($LoginType) && !isset($_GET['mainPage']) && ($LoginType == "seniorDispatch"))
    	{
    		$leftMenu = "sideMenu.php";
    		$mainPage = "dispatchMain.php";
    	}
    	elseif (isset($LoginType) && isset($_GET['mainPage']) && ($LoginType == "seniorDispatch"))
    	{
    		$leftMenu = "sideMenu.php";
    		if ($_GET['mainPage'] == "dispatchMain")
    		{
    			$mainPage = "dispatchMain.php";
    		}
    		elseif ($_GET['mainPage'] == "addUser")
    		{
    			$mainPage = "addUser.php";
    		}
    		elseif ($_GET['mainPage'] == "addAlarmCo")
    		{
    			$mainPage = "addAlarmCo.php";
    		}
    		elseif ($_GET['mainPage'] == "addClient")
    		{
    			$mainPage = "addClient.php";
    		}
    		elseif ($_GET['mainPage'] == "addSite")
    		{
    			$mainPage = "addSite.php";
    		}
    		elseif ($_GET['mainPage'] == "addCar")
    		{
    			$mainPage = "addCar.php";
    		}
    		elseif ($_GET['mainPage'] == "addDirective")
    		{
    			$mainPage = "addDirective.php";
    		}
    		elseif ($_GET['mainPage'] == "carAssign")
    		{
    			$mainPage = "carAssign.php";
    		}
    		elseif ($_GET['mainPage'] == "shiftReportList")
    		{
    			$mainPage = "shiftReportList.php";
    		}
    		elseif ($_GET['mainPage'] == "dailyReport")
    		{
    			$mainPage = "dailyReportForm.php";
    		}
    		elseif ($_GET['mainPage'] == "alarmReports")
    		{
    			$mainPage = "alarmReports.php";
    		}
    		elseif ($_GET['mainPage'] == "preventiveReports")
    		{
    			$mainPage = "preventiveReports.php";
    		}
    		elseif ($_GET['mainPage'] == "addTemplate")
    		{
    			$mainPage = "addTemplate.php";
    		}
    	}
     
    	//Page creation and redirection for the TIMEZONE login and menu updates
    	if (isset($LoginType) && !isset($_GET['mainPage']) && ($LoginType == "timeZone"))
    	{
    		$leftMenu = "sideMenu.php";
    		$mainPage = "timezones.php";
    	}
     
    	//This variable controls how often the page is refreshed and is in seconds
    	if($mainPage == "dispatchMain.php" && ($LoginType == "dispatch" || $LoginType == "admin"))
    	{
    		$reloadTime = "30000";
    		$retryTime = "5000";
    	}
    	else if ($LoginType == "patrol" && $mainPage == "patrolMain.php")
    	{
    		$reloadTime = "300000";
    		$retryTime = "5000";
    	}
    	else if ($LoginType == "seniorDispatch" && $mainPage == "dispatchMain.php")
    	{
    		$reloadTime = "30000";
    		$retryTime = "5000";
    	}
    	else if ($LoginType == "client" && $mainPage == "clientMain.php")
    	{
    		$reloadTime = "60000";
    		$retryTime = "5000";
    	}
    	else if ($LoginType == "timeZone")
    	{
    		$reloadTime = "30000";
    		$retryTime = "5000";
    	}
    	else
    	{
    		$reloadTime = "4320000000";
    		$retryTime = "4320000000";
    	}
     
    	if ($LoginType == "patrol")
    	{
    		$getCarIDSQL = "SELECT carID, code FROM car WHERE patrollerUserID = '".$LogedUserID."'";
    		$getCarIDResult = mysqli_query($con,$getCarIDSQL) or die('Query failed: ' . mysqli_error($con));
    		$numOfRows = mysqli_num_rows($getCarIDResult);
    		if ($numOfRows != 0)
    		{
    			$_SESSION['PATROLER_CAR_ID'] = mysqli_fetch_row($getCarIDResult,0,"carID");
    			$_SESSION['CAR_CODE'] = mysqli_fetch_row($getCarIDResult,0,"code");
    			$infoDisplay = "Voiture assign: ".$_SESSION['CAR_CODE'];
    		}
    		else
    		{
    			$_SESSION['CAR_CODE'] = "non assign";
    			$_SESSION['PATROLER_CAR_ID'] = 0;
    			$infoDisplay = "Aucune voiture vous a t assigner; AVISER RPARTITION";
    		}
    	}
    ?>
    <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
    <html xmlns="http://www.w3.org/1999/xhtml">
    <head>
    <meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" />
    <title>C.A.D. Menu Principal</title>
    <link rel="stylesheet" href="css/layout.css" type="text/css"/>
    <style type="text/css" media="screen">
    /**************** menu coding *****************/
    #menu {
    margin-top:55px;
    width: 140px;
    background: #336699;
    }
    #menu ul {
    list-style: none;
    margin: 0;
    width: 140px;
    padding: 0;
    }
    #menu a, #menu h2 {
    font: bold 11px/16px arial, helvetica, sans-serif;
    display: block;
    border-width: 1px;
    border-style: solid;
    border-color: #ccc #888 #555 #bbb;
    margin: 0;
    padding: 2px 3px;
    }
    #menu a:hover {
    color: #a00;
    background: #fff;
    }
    #menu li {
    position: relative;
    }
    #menu ul ul ul {
    position: absolute;
    top: 0;
    left: 100%;
    width: 100%;
    }
    div#menu ul ul ul,
    div#menu ul ul li:hover ul ul
    {display: none;}
     
    div#menu ul ul li:hover ul,
    div#menu ul ul ul li:hover ul
    {display: block;}
     
    </style>
    <!--[if IE]>
    <style type="text/css" media="screen">
     #menu ul li {float: left; width: 100%;}
    </style>
    <![endif]-->
    <!--[if lt IE 7]>
    <style type="text/css" media="screen">
    body {
    behavior: url(csshover.htc);
    font-size: 100%;
    }
    #menu ul li {float: left; width: 100%;}
    #menu ul li a {height: 1%;}
     
    #menu a, #menu h2 {
    font: bold 0.7em/1.4em arial, helvetica, sans-serif;
    }
     
    </style>
    <![endif]-->
    <script type="text/javascript" src="JSCal2/js/jscal2.js"></script>
    <script type="text/javascript" src="JSCal2/js/lang/fr.js"></script>
    <script type="text/javascript" src="javascript/functions.js"></script>
    <script type="text/javascript" src="javascript/formatdate.js"></script>
    <script type="text/javascript" src="autosuggest/js/AutoSuggest.js"></script>
    <script type="text/javascript" src="javascript/ddaccordion.js"></script>
    <script type="text/javascript" src="javascript/jquery.min.js"></script>
    <link rel="stylesheet" href="autosuggest/css/autosuggest_inquisitor.css" type="text/css" media="screen"/>
    <link rel="stylesheet" type="text/css" href="JSCal2/css/jscal2.css" />
    <link rel="stylesheet" type="text/css" href="JSCal2/css/steel/steel.css" />
    <script type="text/javascript" language="javascript">
    function confirmTenCode(TenCode, Location, PassedID, CarID, ExternalID, Type)
    {
    	confirmResponse = "";
    	confirmResponse = confirm("Êtes-vous vraiement en " + TenCode + " pour " + Location + "?");
    	if(confirmResponse)
    	{
    		var passedString = 'scripts/tenCodeSave.php?passedID=' + PassedID + '&tenCode=' + TenCode + '&type=' + Type + '&location=' + Location + '&carID=' + CarID + '&externalID=' + ExternalID;
    		//alert(passedString);
    		tenCodePopUp = popUp(passedString,'console',300,200,'TenCodeSaveWin');
    		tenCodePopUp.focus();
    		return true;
    	}
    	else
    	{
    		return false;
    	}
    }
    function confirmLogOff()
    {
    <?php
    /*
    	if (($FirstLogin == false) && ($LoginType != "manager") && ($LoginType != "root") && ($LoginType != "client") && ($LoginType != "admin") && ($LoginType != "timeZone"))
    	{
    		echo "\tconfirmResponse = \"\";\r\n";
    		echo "\tconfirmResponse = confirm('Si c\'est la fin de votre quart, est-ce que vous avez fait votre \"10-38\"?');\r\n";
    		echo "\tif(confirmResponse)\r\n";
    		echo "\t{\r\n";
    			echo "\t\tdocument.location='scripts/logout.php';\r\n";
    			echo "\t\treturn true;\r\n";
    		echo "\t}\r\n";
    		echo "\telse\r\n";
    		echo "\t{\r\n";
    			echo "\t\treturn false;\r\n";
    		echo "\t}\r\n";
    	}
    	else
    	{*/
    		echo "document.location='scripts/logout.php';\r\n";
    		echo "return true;\r\n";
    	//}
    ?>
    }
    function clientConfirmLogOff()
    {
    	document.location='scripts/client_logout.php';
    	return true;
    }
    //Function used to collapse all information containers on the main page
    function collapseAllInPage()
    {
    	ddaccordion.collapseall('alarmResponse');
    	ddaccordion.collapseall('specialPreventiveTemplate');
    	ddaccordion.collapseall('preventiveTemplate');
    }
    //Function used to expand all information containers on the main page
    function expandAllInPage()
    {
    	ddaccordion.expandall('alarmResponse');
    	ddaccordion.expandall('specialPreventiveTemplate');
    	ddaccordion.expandall('preventiveTemplate');
    }
    <?php
    /*
    	if (($FirstLogin == true) && ($LoginType != "manager") && ($LoginType != "root") && ($LoginType != "client") && ($LoginType != "admin") && ($LoginType != "timeZone"))
    	{
    		echo "customAlert('noubliez pas de faire votre 10-35 si c\'est le d&eacute;but de votre quart!!!');";
    		$_SESSION['INITIAL_LOGIN'] = false;
    	}
     */
    ?>
    function reloadPage()
    {
    	window.location.reload();
    	window.setTimeout('reloadPage()',<?php echo $reloadTime; ?>);
    }
    function place()
    {
    	globalPlace();
    	updateDateTimeNow();
    	<?php if ($LoginType == "timeZone") echo "timeZone();"; ?>
     
    }
    function quickCarAssignChange(passedID, initialCarCode, initialCarID, carSaveType)
    {
    	if (carSaveType == "alarm")
    	{
    		finalCarCode = document.getElementById('CarAssignList-A-' + passedID).options[document.getElementById('CarAssignList-A-' + passedID).selectedIndex].text;
    		finalCarID = document.getElementById('CarAssignList-A-' + passedID).value;
    	}
    	else if (carSaveType == "preventive")
    	{
    		finalCarCode = document.getElementById('CarAssignList-P-' + passedID).options[document.getElementById('CarAssignList-P-' + passedID).selectedIndex].text;
    		finalCarID = document.getElementById('CarAssignList-P-' + passedID).value;
    	}
     
    	if (finalCarCode == "n/a")
    	{
    		confirmResponse = confirm('Etes vous sur d\'assigner la voiture ' + finalCarCode + ' a cette alarme?');
    	}
    	else
    	{
    		confirmResponse = confirm('Etes vous sur d\'assigner la voiture ' + initialCarCode + ' a ' + finalCarCode + '?');
    	}
     
    	if(confirmResponse)
    	{
    		passedString = 'scripts/quickCarAssignSave.php?passedID=' + passedID + '&carID=' + finalCarID + '&carSaveType=' + carSaveType + '&initialCarID=' + initialCarID;
    		quickCarAssignPopUp = popUp(passedString,'fixed',400,150,'quickCarAssignSaveWindow');
    		window.opener.focus();
    		return true;
    	}
    	else
    	{
    		return false;
    	}
    }
     
    /*
    var BrowserDetect = {
    	init: function () {
    		this.browser = this.searchString(this.dataBrowser) || "An unknown browser";
    		this.version = this.searchVersion(navigator.userAgent)
    			|| this.searchVersion(navigator.appVersion)
    			|| "an unknown version";
    		this.OS = this.searchString(this.dataOS) || "an unknown OS";
    	},
    	searchString: function (data) {
    		for (var i=0;i<data.length;i++)	{
    			var dataString = data[i].string;
    			var dataProp = data[i].prop;
    			this.versionSearchString = data[i].versionSearch || data[i].identity;
    			if (dataString) {
    				if (dataString.indexOf(data[i].subString) != -1)
    					return data[i].identity;
    			}
    			else if (dataProp)
    				return data[i].identity;
    		}
    	},
    	searchVersion: function (dataString) {
    		var index = dataString.indexOf(this.versionSearchString);
    		if (index == -1) return;
    		return parseFloat(dataString.substring(index+this.versionSearchString.length+1));
    	},
    	dataBrowser: [
    		{ 	string: navigator.userAgent,
    			subString: "OmniWeb",
    			versionSearch: "OmniWeb/",
    			identity: "OmniWeb"
    		},
    		{
    			string: navigator.vendor,
    			subString: "Apple",
    			identity: "Safari"
    		},
    		{
    			prop: window.opera,
    			identity: "Opera"
    		},
    		{
    			string: navigator.vendor,
    			subString: "iCab",
    			identity: "iCab"
    		},
    		{
    			string: navigator.vendor,
    			subString: "KDE",
    			identity: "Konqueror"
    		},
    		{
    			string: navigator.userAgent,
    			subString: "Firefox",
    			identity: "Firefox"
    		},
    		{
    			string: navigator.vendor,
    			subString: "Camino",
    			identity: "Camino"
    		},
    		{		// for newer Netscapes (6+)
    			string: navigator.userAgent,
    			subString: "Netscape",
    			identity: "Netscape"
    		},
    		{
    			string: navigator.userAgent,
    			subString: "MSIE",
    			identity: "Explorer",
    			versionSearch: "MSIE"
    		},
    		{
    			string: navigator.userAgent,
    			subString: "Gecko",
    			identity: "Mozilla",
    			versionSearch: "rv"
    		},
    		{ 		// for older Netscapes (4-)
    			string: navigator.userAgent,
    			subString: "Mozilla",
    			identity: "Netscape",
    			versionSearch: "Mozilla"
    		}
    	],
    	dataOS : [
    		{
    			string: navigator.platform,
    			subString: "Win",
    			identity: "Windows"
    		},
    		{
    			string: navigator.platform,
    			subString: "Mac",
    			identity: "Mac"
    		},
    		{
    			string: navigator.platform,
    			subString: "Linux",
    			identity: "Linux"
    		}
    	]
     
    };
    BrowserDetect.init();
    alert('Browser used: ' + BrowserDetect.browser + ' version: ' + BrowserDetect.version);
    */
    </script>
    <script type="text/javascript">
        var cal = Calendar.setup({
            weekNumbers: true,
            fdow: 0,
            onSelect: function(cal) { cal.hide() }
        });
    </script>
    </head>
    <body onload="place()">
    <!-- This is the header area of the site-->
    <div class="header">
    <?php
     
    	if ($LoginType != "client")
    	{
    		$assignedCarListSQL = "SELECT * FROM carassignmentLog cal, user, car WHERE car.carID = cal.carID AND cal.patrollerUserID = user.userID AND cal.shiftEndDateTime IS NULL
    		AND cal.carID >=  '50' ORDER BY user.lname ASC";
    		$assignedCarListResult = mysqli_query($con,$assignedCarListSQL) or die('Query[assignedCarListSQL] failed: ' . mysqli_error($con));
    		$assignedCarListNumOfRows = mysqli_num_rows($assignedCarListResult);
     
    		if ($assignedCarListNumOfRows)
    		{
    			echo "<table border=\"0\" width=\"100%\" align=\"right\">\n";
    			echo "\t<tr>\n";
    			for ($i = 0; $i < $assignedCarListNumOfRows; $i++)
    			{
    				if ($i%2 == 0 && $i != 0){
    					echo "</tr><tr>\n";
                    }
                    if (mysqli_fetch_row($assignedCarListResult, $i, "car.state") == "alarm")
                        echo "\t\t<td style=\"background-color: #CC0033;\"><b>".mysqli_fetch_row($assignedCarListResult,$i,"car.code")."</b> - ".mysqli_fetch_row($assignedCarListResult,$i,"user.lname").", ".substr(mysqli_fetch_row($assignedCarListResult,$i,"user.fname"),0,1)." | ".mysqli_fetch_row($assignedCarListResult,$i,"cal.shiftStartTime")." &agrave; ".mysqli_fetch_row($assignedCarListResult,$i,"cal.shiftEndTime")." | <i>".mysqli_fetch_row($assignedCarListResult,$i,"cal.sector")."</i></td>\n";
                    else if (mysqli_fetch_row($assignedCarListResult, $i, "car.state") == "preventive")
                        echo "\t\t<td style=\"background-color: #FFEE00;color:black;\"><b>".mysqli_fetch_row($assignedCarListResult,$i,"car.code")."</b> - ".mysqli_fetch_row($assignedCarListResult,$i,"user.lname").", ".substr(mysqli_fetch_row($assignedCarListResult,$i,"user.fname"),0,1)." | ".mysqli_fetch_row($assignedCarListResult,$i,"cal.shiftStartTime")." &agrave; ".mysqli_fetch_row($assignedCarListResult,$i,"cal.shiftEndTime")." | <i>".mysqli_fetch_row($assignedCarListResult,$i,"cal.sector")."</i></td>\n";
                    else
                        echo "\t\t<td><b>".mysqli_fetch_row($assignedCarListResult,$i,"car.code")."</b> - ".mysqli_fetch_row($assignedCarListResult,$i,"user.lname").", ".substr(mysqli_fetch_row($assignedCarListResult,$i,"user.fname"),0,1)." | ".mysqli_fetch_row($assignedCarListResult,$i,"cal.shiftStartTime")." &agrave; ".mysqli_fetch_row($assignedCarListResult,$i,"cal.shiftEndTime")." | <i>".mysqli_fetch_row($assignedCarListResult,$i,"cal.sector")."</i></td>\n";
    			}
    			echo "\t</tr>\n";
    			echo "</table>\n";
    		}
    	}
    ?>
    </div>
     
    <!-- This is the left menu side of the site -->
    <div class="leftMenu">
        <div id="menu">
    <?php
     
    	include ($leftMenu); 	//Call the appropriate left Menu depending on who logs in
     
    ?>
    </div>
    </div>
     
    <!-- This is the main displaying area of the site-->
    <div class="main">
    <?php
     
    	include ($mainPage);
     
    ?>
    </div>
     
    <!-- This sections is always the same -->
    <div class="footer">
    	<?php include("homeFooter.php"); ?>
    </div>
     
     
    </body>
    <script type="text/javascript" language="javascript">
        window.setTimeout('reloadPage()',<?php echo $reloadTime; ?>);
    </script>
    </html>
    loggedin.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
    <?php
    	/******************************************************************************
    	 *  Last Modified by: Mike
    	 *  Date: 2008-04-14
    	 *  
    	 *  Description: This checks the login credentials and redirects accordingly
    	 * ***************************************************************************/
     
    	header("Expires: Thu, 17 May 2001 10:17:17 GMT");    // Date in the past
      	header ("Last-Modified: " . gmdate("D, d M Y H:i:s") . " GMT"); // always modified
    	header ("Cache-Control: no-cache, must-revalidate");  // HTTP/1.1
    	header ("Pragma: no-cache");                          // HTTP/1.0
     
    	session_start();
     
    	if (!isset($_SESSION['SESSION'])) require ("session_init.php");
     
    	// reset session variables...
    	$_SESSION['LOGIN_TYPE'] = "";
    	$_SESSION['USERNAME'] = "";
    	$_SESSION['LOGGEDIN'] = false;
    	$_SESSION['FNAME'] = "";
    	$_SESSION['LNAME'] = "";
     
    	// initialize variables...
    	$username = "";
    	$password = "";
    	$email = "";
     
    	// make sure post parameters were sent...
    	if (isset($_REQUEST["username"])) $username = $_REQUEST["username"];
    	if (isset($_REQUEST["password"])) $password = $_REQUEST["password"];
     
    	// form variables must have something in them...
    	if ($username == "" || $password == "") { header("Location: ../index.php?flg=red&username=".$username); exit; }
     
    	// check in database...
    	$query = "SELECT * FROM user, position WHERE user.positionID = position.positionID AND logonName = '".$username."'";
     
    	$con = mysqli_connect($_SESSION['MYSQL_SERVER'],$_SESSION['MYSQL_LOGIN'],$_SESSION['MYSQL_PASS'],$_SESSION['MYSQL_DB']) or die("Unable to connect to SQL server");
     
    	$result = mysqli_query($con,$query) or die("Invalid query: " . mysqli_error($con));
     
    	// if username is not present in user table try the client table
    	if (mysqli_affected_rows($con) != 1) 
    	{
    		$clientUserSQL = "SELECT * FROM client_user WHERE logonName = '".$username."'";
    		$clientUserResult = mysqli_query($con,$clientUserSQL) or die ("Invalide Query[clientUserSQL]: " . mysqli_error($con));
     
    		if (mysqli_affected_rows($con) != 1) 
    		{ 
    			header("Location: ../index.php?flg=red&username=".$username); exit; 
    		}
    		else
    		{
    			// check for password, active state, user type, and then send to appropriate section...
    			if ($clientUserRow = mysqli_fetch_assoc($clientUserResult)) 
    			{
    				#echo $row['sPassword'] . "<br>" . md5($password);
    				if ((strcmp($clientUserRow['logonPWD'], md5($password)) != 0) || (strcmp($clientUserRow['statusID'],"24") != 0))
    				{ 
    					header("Location: ../index.php?flg=red&username=".$username); exit; 
    				}
     
    				// set standard session variables...
    				$_SESSION['LOGIN_TYPE'] = "client";
    				$_SESSION['LOGED_USERID'] = $clientUserRow['clientUserID'];
    				$_SESSION['LOGED_USER_CLIENTID'] = $clientUserRow['clientID'];
    				$_SESSION['USER_STATUS'] = $clientUserRow['statusID'];
    				$_SESSION['USERNAME'] = $username;
    				$_SESSION['LOGGEDIN'] = true;
    				$_SESSION['FNAME'] = $clientUserRow['fname'];
    				$_SESSION['LNAME'] = $clientUserRow['lname'];
     
    				header("Location: ../welcome.php");	exit;
    			} 
    			else 
    			{	
    				header("Location: ../index.php?flg=red&username=".$username); exit;
     
    			}
    		}
    	}		
    	else
    	{
    		// check for password, active state, user type, and then send to appropriate section...
    		if ($row = mysqli_fetch_assoc($result)) 
    		{
    			#echo $row['sPassword'] . "<br>" . md5($password);
    			if ((strcmp($row['logonPWD'], md5($password)) != 0) || (strcmp($row['statusID'],"1") != 0))
    			{ 
    				header("Location: ../index.php?flg=red&username=".$username); exit; 
    			}
     
    			// set standard session variables...
    			$_SESSION['LOGIN_TYPE'] = $row['loginType'];
    			$_SESSION['LOGIN_POSITION_NAME'] = $row['positionName'];
                $_SESSION['LOGED_USER_CLIENTID'] = 0;
    			$_SESSION['LOGED_USERID'] = $row['userID'];
    			$_SESSION['USER_STATUS'] = $row['statusID'];
    			$_SESSION['USERNAME'] = $username;
    			$_SESSION['LOGGEDIN'] = true;
    			$_SESSION['FNAME'] = $row['fname'];
    			$_SESSION['LNAME'] = $row['lname'];
     
    			header("Location: ../welcome.php"); exit;	
    		} 
    		else 
    		{
    			header("Location: ../index.php?flg=red&username=".$username); exit;
    		}	
    	}	
    ?>

  4. #4
    Candidat au Club
    Homme Profil pro
    Architecte réseau
    Inscrit en
    Mars 2017
    Messages
    10
    Détails du profil
    Informations personnelles :
    Sexe : Homme
    Âge : 40
    Localisation : Canada

    Informations professionnelles :
    Activité : Architecte réseau

    Informations forums :
    Inscription : Mars 2017
    Messages : 10
    Points : 4
    Points
    4
    Par défaut
    Ou mysqli pour ce connecter a la base de donnée les commandes ne sont plus les même

    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
    <?php
    	$_SESSION['APP_MX'] = "mail.cbina.com";
    	$_SESSION['SITE_SERVER'] = "localhost";
    	$_SESSION['WEBMASTER_EMAIL'] = "cad@cbina.com";
     
    	$_SESSION['MYSQL_SERVER'] = "localhost";
    	$_SESSION['MYSQL_LOGIN'] = "root";
    	$_SESSION['MYSQL_PASS'] = "CB*4230*";
    	$_SESSION['MYSQL_DB'] = "cbina";
     
    	$_SESSION['LOGGEDIN'] = "";
    	$_SESSION['LOGIN_TYPE'] = "";
    	$_SESSION['LOGED_USERID'] = "";
    	$_SESSION['USERNAME'] = "";
     
    	$_SESSION['EMAIL'] = "";
    	$_SESSION['FNAME'] = "";
    	$_SESSION['LNAME'] = "";
     
    	$_SESSION['SESSION'] = true;
    	$_SESSION['INITIAL_LOGIN'] = true;
     
    ?>

  5. #5
    Candidat au Club
    Homme Profil pro
    Architecte réseau
    Inscrit en
    Mars 2017
    Messages
    10
    Détails du profil
    Informations personnelles :
    Sexe : Homme
    Âge : 40
    Localisation : Canada

    Informations professionnelles :
    Activité : Architecte réseau

    Informations forums :
    Inscription : Mars 2017
    Messages : 10
    Points : 4
    Points
    4
    Par défaut
    Citation Envoyé par mathieu Voir le message
    montrez nous le code que vous avez modifié et qui a produit ce problème
    Je suis presque sur que le problème viens du fichier loggedin.php mais je n'arrive pas a trouver ou. En dirait qui est pas capable une fois le username vérifier de l'envoyer sur la page index.php

  6. #6
    Candidat au Club
    Homme Profil pro
    Architecte réseau
    Inscrit en
    Mars 2017
    Messages
    10
    Détails du profil
    Informations personnelles :
    Sexe : Homme
    Âge : 40
    Localisation : Canada

    Informations professionnelles :
    Activité : Architecte réseau

    Informations forums :
    Inscription : Mars 2017
    Messages : 10
    Points : 4
    Points
    4
    Par défaut conversion en my_sqli
    Est ce que une personne pourrais m'aider a convertir le code suivant en my_sqli je viens de trouver qui manquait une section en my_sqli

    Code : Sélectionner tout - Visualiser dans une fenêtre à part
    1
    2
    3
    4
    5
    $query = "SELECT * FROM user, position WHERE user.positionID = position.positionID AND logonName = '".$username."'";
     
    	mysql_pconnect($_SESSION['MYSQL_SERVER'],$_SESSION['MYSQL_LOGIN'],$_SESSION['MYSQL_PASS']) or die("Unable to connect to SQL server");
      	mysql_select_db($_SESSION['MYSQL_DB']) or die("Unable to select database");
    	$result = mysql_query($query) or die("Invalid query: " . mysql_error());

Discussions similaires

  1. Problème Conversion REAL --> VARCHAR
    Par YOYOVbSQL dans le forum MS SQL Server
    Réponses: 2
    Dernier message: 30/03/2006, 18h03
  2. [D7][Débutant] Problème conversion String <- TEdit
    Par _alex_ dans le forum Composants VCL
    Réponses: 2
    Dernier message: 16/02/2006, 22h48
  3. Problème conversion temps
    Par Vodkha dans le forum Langage
    Réponses: 5
    Dernier message: 16/02/2006, 15h24
  4. Problème conversion float vers double
    Par jhenaff dans le forum SQL Procédural
    Réponses: 3
    Dernier message: 27/01/2006, 10h39
  5. Problème conversion date
    Par mat.M dans le forum MS SQL Server
    Réponses: 2
    Dernier message: 30/03/2004, 15h05

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