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

Dreamweaver Discussion :

Création interface pour compte client.


Sujet :

Dreamweaver

  1. #1
    Invité
    Invité(e)
    Par défaut Création interface pour compte client.
    Bonjour, mon problème est que j'ai fait une base de données de client donc dans la table clients il y a notamment les attributs : nom et motdepasse.

    Je souhaiterai donc faire une interface, quand un client rentre son nom et son mot de passe, il peut voir un tableau propre a lui-même (information prise dans la table clients).

    j'arrive à faire une interface, avec vérification du nom et du mot de passe, si identifier sa bascule sur la page : suivi.php et s'il y a un problème la redirection est faite vers : index_erreur.php.

    Maintenant que la mise en situation est fini je vais décrire mon problème :

    Dans la page suivi.php j'arrive pas tous simplement a récupéré le nom mis par le client. Je souhaiterais donc que le nom rentré dans le champ doit être servi pour faire l'appel du tableau dans la page suivi.php.

    ma page index.php.
    Code php : 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
     <?php require_once('../Connections/local.php'); ?>
    <?php
    if (!function_exists("GetSQLValueString")) {
    function GetSQLValueString($theValue, $theType, $theDefinedValue = "", $theNotDefinedValue = "") 
    {
      if (PHP_VERSION < 6) {
        $theValue = get_magic_quotes_gpc() ? stripslashes($theValue) : $theValue;
      }
     
      $theValue = function_exists("mysql_real_escape_string") ? mysql_real_escape_string($theValue) : mysql_escape_string($theValue);
     
      switch ($theType) {
        case "text":
          $theValue = ($theValue != "") ? "'" . $theValue . "'" : "NULL";
          break;    
        case "long":
        case "int":
          $theValue = ($theValue != "") ? intval($theValue) : "NULL";
          break;
        case "double":
          $theValue = ($theValue != "") ? doubleval($theValue) : "NULL";
          break;
        case "date":
          $theValue = ($theValue != "") ? "'" . $theValue . "'" : "NULL";
          break;
        case "defined":
          $theValue = ($theValue != "") ? $theDefinedValue : $theNotDefinedValue;
          break;
      }
      return $theValue;
    }
    }
     
    mysql_select_db($database_local, $local);
    $query_client = "SELECT * FROM clients";
    $client = mysql_query($query_client, $local) or die(mysql_error());
    $row_client = mysql_fetch_assoc($client);
    $totalRows_client = mysql_num_rows($client);
    ?>
    <?php
    // *** Validate request to login to this site.
    if (!isset($_SESSION)) {
      session_start();
    }
     
    $loginFormAction = $_SERVER['PHP_SELF'];
    if (isset($_GET['accesscheck'])) {
      $_SESSION['PrevUrl'] = $_GET['accesscheck'];
    }
     
    if (isset($_POST['nom'])) {
      $loginUsername=$_POST['nom'];
      $password=$_POST['motdepasse'];
      $MM_fldUserAuthorization = "";
      $MM_redirectLoginSuccess = "suivi.php";
      $MM_redirectLoginFailed = "index_erreur.php";
      $MM_redirecttoReferrer = false;
      mysql_select_db($database_local, $local);
     
      $LoginRS__query=sprintf("SELECT nom, motdepasse FROM clients WHERE nom=%s AND motdepasse=%s",
        GetSQLValueString($loginUsername, "text"), GetSQLValueString($password, "text")); 
     
      $LoginRS = mysql_query($LoginRS__query, $local) or die(mysql_error());
      $loginFoundUser = mysql_num_rows($LoginRS);
      if ($loginFoundUser) {
         $loginStrGroup = "";
     
    	if (PHP_VERSION >= 5.1) {session_regenerate_id(true);} else {session_regenerate_id();}
        //declare two session variables and assign them
        $_SESSION['MM_Username'] = $loginUsername;
        $_SESSION['MM_UserGroup'] = $loginStrGroup;	      
     
        if (isset($_SESSION['PrevUrl']) && false) {
          $MM_redirectLoginSuccess = $_SESSION['PrevUrl'];	
        }
        header("Location: " . $MM_redirectLoginSuccess );
      }
      else {
        header("Location: ". $MM_redirectLoginFailed );
      }
    }
    ?>
    <!doctype html>
    <html>
    <head>
    <meta charset="utf-8">
    <title>Suivi</title>
    <link href="../style/reset.css" rel="stylesheet" type="text/css">
    <link href="../style/css page.css" rel="stylesheet" type="text/css">
    <link href="style/style suivi.css" rel="stylesheet" type="text/css">
    </head>
    <body>
    <div class="header">
    	<img src="../images/batideal.jpg" width="156" height="155" alt="batideal">
    </div>
    <div class="centre">
    <p>Poussez la porte de la concrétisation de vos projets du bâtiment.</p>
    <br><br>
    <form ACTION="<?php echo $loginFormAction; ?>" name="login" METHOD="POST">
    <table width="400px" border="0">
      <tr>
        <td>Utilisateur :</td>
        <td><input name="nom" type="text"></td>
      </tr>
      <tr>
        <td>Mot de passe : </td>
        <td><input name="motdepasse" type="texte"></td>
      </tr>
      <tr>
        <td>&nbsp;</td>
        <td></td>
      </tr>
     
    </table>
    <input type="submit" value="envoyer">
    </form>
    </div>
    </body>
    </html>
    <?php
    mysql_free_result($client);
    ?>

    la page suivi.php :
    Code php : 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
    <?php require_once('../Connections/local.php'); ?>
    <?php
    if (!function_exists("GetSQLValueString")) {
    function GetSQLValueString($theValue, $theType, $theDefinedValue = "", $theNotDefinedValue = "") 
    {
      if (PHP_VERSION < 6) {
        $theValue = get_magic_quotes_gpc() ? stripslashes($theValue) : $theValue;
      }
     
      $theValue = function_exists("mysql_real_escape_string") ? mysql_real_escape_string($theValue) : mysql_escape_string($theValue);
     
      switch ($theType) {
        case "text":
          $theValue = ($theValue != "") ? "'" . $theValue . "'" : "NULL";
          break;    
        case "long":
        case "int":
          $theValue = ($theValue != "") ? intval($theValue) : "NULL";
          break;
        case "double":
          $theValue = ($theValue != "") ? doubleval($theValue) : "NULL";
          break;
        case "date":
          $theValue = ($theValue != "") ? "'" . $theValue . "'" : "NULL";
          break;
        case "defined":
          $theValue = ($theValue != "") ? $theDefinedValue : $theNotDefinedValue;
          break;
      }
      return $theValue;
    }
    }
     
    $colname_clients = "-1";
    if (isset($_GET['nom'])) {
      $colname_clients = $_GET['nom'];
    }
    mysql_select_db($database_local, $local);
    $query_clients = sprintf("SELECT * FROM clients WHERE nom = %s", GetSQLValueString($colname_clients, "text"));
    $clients = mysql_query($query_clients, $local) or die(mysql_error());
    $row_clients = mysql_fetch_assoc($clients);
    $totalRows_clients = mysql_num_rows($clients);
     
    $colname_suivi = "-1";
    if (isset($_GET['motdepasse'])) {
      $colname_suivi = $_GET['motdepasse'];
    }
    mysql_select_db($database_local, $local);
    $query_suivi = sprintf("SELECT * FROM clients WHERE motdepasse = %s", GetSQLValueString($colname_suivi, "text"));
    $suivi = mysql_query($query_suivi, $local) or die(mysql_error());
    $row_suivi = mysql_fetch_assoc($suivi);
     
    $colname_suivi = "-1";
    if (isset($_GET['motdepasse'])) {
      $colname_suivi = $_GET['motdepasse'];
    }
    mysql_select_db($database_local, $local);
    $query_suivi = sprintf("SELECT * FROM clients WHERE motdepasse = %s", GetSQLValueString($colname_suivi, "text"));
    $suivi = mysql_query($query_suivi, $local) or die(mysql_error());
    $row_suivi = mysql_fetch_assoc($suivi);
     
    $query_suivi = "SELECT * FROM clients WHERE nom = 'nom'";
    $suivi = mysql_query($query_suivi, $local) or die(mysql_error());
    $row_suivi = mysql_fetch_assoc($suivi);
    $totalRows_suivi = mysql_num_rows($suivi);
     
    $colname_suivi = "-1";
    if (isset($_SESSION['nom'])) {
      $colname_suivi = $_SESSION['nom'];
    }
    mysql_select_db($database_local, $local);
    $query_suivi = sprintf("SELECT * FROM clients WHERE nom = %s", GetSQLValueString($colname_suivi, "text"));
    $suivi = mysql_query($query_suivi, $local) or die(mysql_error());
    $row_suivi = mysql_fetch_assoc($suivi);
     
    $colname_suivi = "-1";
    if (isset($_GET['nom'])) {
      $colname_suivi = $_GET['nom'];
    }
    mysql_select_db($database_local, $local);
    $query_suivi = sprintf("SELECT * FROM clients WHERE nom = %s", GetSQLValueString($colname_suivi, "text"));
    $suivi = mysql_query($query_suivi, $local) or die(mysql_error());
    $row_suivi = mysql_fetch_assoc($suivi);
    ?>
    <!doctype html>
    <html>
    <head>
    <meta charset="utf-8">
    <title>Suivi</title>
    <link href="../style/reset.css" rel="stylesheet" type="text/css">
    <link href="../style/css page.css" rel="stylesheet" type="text/css">
    <link href="style/style suivi.css" rel="stylesheet" type="text/css">
    </head>
    <body>
    <div class="header">
    	<img src="../images/batideal.jpg" width="156" height="155" alt="batideal">
    </div>
    <div class="centre">
    <p>Poussez la porte de la concrétisation de vos projets du bâtiment.</p>
    <br>
    <p><?php echo $row_suivi['nom']; ?></p>
    <br><br><br><br>
    <form action="" method="POST">
        <table width="400px" border="0">
      <tr>
        <td>Nom :</td>
        <td>&nbsp;</td>
      </tr>
      <tr>
        <td>&nbsp;</td>
        <td>&nbsp;</td>
      </tr>
      <tr>
        <td>Mot de passe :</td>
        <td><?php echo $row_suivi['motdepasse']; ?></td>
      </tr>
      <tr>
        <td>&nbsp;</td>
        <td>&nbsp;</td>
      </tr>
      <tr>
        <td>&nbsp;</td>
        <td>&nbsp;</td>
      </tr>
    </table>
     
    </form>
    </div>
    </body>
    </html>
    <?php
    mysql_free_result($clients);
    ?>

    Merci pour l'aide
    Dernière modification par Bovino ; 24/01/2013 à 15h30. Motif: Merci d'indiquer le langage utilisé ([code=xxx]) !

  2. #2
    Membre habitué
    Profil pro
    Inscrit en
    Décembre 2010
    Messages
    99
    Détails du profil
    Informations personnelles :
    Localisation : France

    Informations forums :
    Inscription : Décembre 2010
    Messages : 99
    Points : 129
    Points
    129
    Par défaut
    Bonjour,

    Je note que tu utilises la partie "Authentification de l'utilisateur" de DW.

    Le script d'authentification de DW garde en session l'ID de l'utilisateur (Champ Nom d'utilisateur) dans la variable $_SESSION['MM_Username'].

    Dans ta page suivi.php tu peux simplement faire tes requêtes en utilisant cette variable pour sélectionner et afficher les informations de ton utilisateur connecté.

    PS : penses à ajouter "Authentification de l'utilisateur > Restreindre l'accès à la page" sur toutes tes pages et scripts de backoffice. C'est plus sécurisé et cela permet plus facilement d'utiliser $_SESSION['MM_Username'].

    Sinon penses à ajouter à la main dans les pages ayant besoin d'accéder aux variables de session :
    Code php : Sélectionner tout - Visualiser dans une fenêtre à part
    1
    2
    3
    if ( !isset($_SESSION) ) {
      session_start();
    }

  3. #3
    Invité
    Invité(e)
    Par défaut
    Bonjour,
    1) je viens de me rendre compte que la page index.php une fois remplie et valider reviens sur index.php..

    donc je ne vais pas sur la page suivi.php

    merci de me dire ou peux bien être l'erreur.. merci beaucoup


    2) Pour la page suivi.php si je fait sur dreamweaver "nouveau jeux d'enregistrement" je choisi la bonne table sql et que dans "filtre" je mette l'entité "nom" "=" "variable session" "nom"

    sa va récupéré la valeur de la session de la page index ?? donc pas besoin de mettre le code mis juste au dessus ?? Merci

  4. #4
    Membre habitué
    Profil pro
    Inscrit en
    Décembre 2010
    Messages
    99
    Détails du profil
    Informations personnelles :
    Localisation : France

    Informations forums :
    Inscription : Décembre 2010
    Messages : 99
    Points : 129
    Points
    129
    Par défaut
    Bonjour,

    1/ Dans ton fichier index.php ton champ 'motdepasse' est de type="texte"... le type "texte" (en français) n'existe pas => à corriger par type="text" ou plus adapté type="password".

    2/ Pour ton fichier suivi.php.
    On va reprendre à zero :
    - Commencer par faire "Authentification de l'utilisateur > Restreindre l'accès à la page". Cette operation permet de sécuriser l'accès à cette page ET initialiser la session pour lire les variables de session.
    - Dans ton jeu d'enregistrement 'clients' faire Filtre 'nom' = Variable de session MM_Username... car c'est dans cette variable que l'ID ((Champ Nom d'utilisateur) de l'utilisateur loggé est stocké.

    Ensuite tu peux insérer les elements liés à ton compte utilisateur via le panneau Liaisons > Jeu d'enregistrements (clients).

    Activer la session à la main permet d'utiliser les elements de session en dehors des pages avec un acces restreint. Par exemple sur la partie publique du site, tu peux donner accès à des elements uniquement visibles par l'administrateur loggé. Le simple visiteur non loggé ne verrait rien. Cela sort du cadre de ta question, c'est simplement pour dire que c'est possible.

    Fichier index.php
    Code php : 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
    <?php require_once('../Connections/local.php'); ?>
    <?php
    if (!function_exists("GetSQLValueString")) {
    function GetSQLValueString($theValue, $theType, $theDefinedValue = "", $theNotDefinedValue = "") 
    {
      if (PHP_VERSION < 6) {
        $theValue = get_magic_quotes_gpc() ? stripslashes($theValue) : $theValue;
      }
     
      $theValue = function_exists("mysql_real_escape_string") ? mysql_real_escape_string($theValue) : mysql_escape_string($theValue);
     
      switch ($theType) {
        case "text":
          $theValue = ($theValue != "") ? "'" . $theValue . "'" : "NULL";
          break;    
        case "long":
        case "int":
          $theValue = ($theValue != "") ? intval($theValue) : "NULL";
          break;
        case "double":
          $theValue = ($theValue != "") ? doubleval($theValue) : "NULL";
          break;
        case "date":
          $theValue = ($theValue != "") ? "'" . $theValue . "'" : "NULL";
          break;
        case "defined":
          $theValue = ($theValue != "") ? $theDefinedValue : $theNotDefinedValue;
          break;
      }
      return $theValue;
    }
    }
     
    mysql_select_db($database_local, $local);
    $query_client = "SELECT * FROM clients";
    $client = mysql_query($query_client, $local) or die(mysql_error());
    $row_client = mysql_fetch_assoc($client);
    $totalRows_client = mysql_num_rows($client);
    ?>
    <?php
    // *** Validate request to login to this site.
    if (!isset($_SESSION)) {
      session_start();
    }
     
    $loginFormAction = $_SERVER['PHP_SELF'];
    if (isset($_GET['accesscheck'])) {
      $_SESSION['PrevUrl'] = $_GET['accesscheck'];
    }
     
    if (isset($_POST['nom'])) {
      $loginUsername=$_POST['nom'];
      $password=$_POST['motdepasse'];
      $MM_fldUserAuthorization = "";
      $MM_redirectLoginSuccess = "suivi.php";
      $MM_redirectLoginFailed = "index_erreur.php";
      $MM_redirecttoReferrer = false;
      mysql_select_db($database_local, $local);
     
      $LoginRS__query=sprintf("SELECT nom, motdepasse FROM clients WHERE nom=%s AND motdepasse=%s",
        GetSQLValueString($loginUsername, "text"), GetSQLValueString($password, "text")); 
     
      $LoginRS = mysql_query($LoginRS__query, $local) or die(mysql_error());
      $loginFoundUser = mysql_num_rows($LoginRS);
      if ($loginFoundUser) {
         $loginStrGroup = "";
     
    	if (PHP_VERSION >= 5.1) {session_regenerate_id(true);} else {session_regenerate_id();}
        //declare two session variables and assign them
        $_SESSION['MM_Username'] = $loginUsername;
        $_SESSION['MM_UserGroup'] = $loginStrGroup;	      
     
        if (isset($_SESSION['PrevUrl']) && false) {
          $MM_redirectLoginSuccess = $_SESSION['PrevUrl'];	
        }
        header("Location: " . $MM_redirectLoginSuccess );
      }
      else {
        header("Location: ". $MM_redirectLoginFailed );
      }
    }
    ?>
    <!doctype html>
    <html>
    <head>
    <meta charset="utf-8">
    <title>Suivi</title>
    <link href="../style/reset.css" rel="stylesheet" type="text/css">
    <link href="../style/css page.css" rel="stylesheet" type="text/css">
    <link href="style/style suivi.css" rel="stylesheet" type="text/css">
    </head>
    <body>
    <div class="header">
    	<img src="../images/batideal.jpg" width="156" height="155" alt="batideal">
    </div>
    <div class="centre">
    <p>Poussez la porte de la concrétisation de vos projets du bâtiment.</p>
    <br><br>
    <form ACTION="<?php echo $loginFormAction; ?>" name="login" METHOD="POST">
    <table width="400px" border="0">
      <tr>
        <td>Utilisateur :</td>
        <td><input name="nom" type="text"></td>
      </tr>
      <tr>
        <td>Mot de passe : </td>
        <td><input name="motdepasse" type="password"></td>
      </tr>
      <tr>
        <td>&nbsp;</td>
        <td></td>
      </tr>
     
    </table>
    <input type="submit" value="envoyer">
    </form>
    </div>
    </body>
    </html>
    <?php
    mysql_free_result($client);
    ?>


    Fichier suivi.php
    Code php : 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
    <?php require_once('../Connections/local.php'); ?>
    <?php
    if (!isset($_SESSION)) {
      session_start();
    }
    $MM_authorizedUsers = "";
    $MM_donotCheckaccess = "true";
     
    // *** Restrict Access To Page: Grant or deny access to this page
    function isAuthorized($strUsers, $strGroups, $UserName, $UserGroup) { 
      // For security, start by assuming the visitor is NOT authorized. 
      $isValid = False; 
     
      // When a visitor has logged into this site, the Session variable MM_Username set equal to their username. 
      // Therefore, we know that a user is NOT logged in if that Session variable is blank. 
      if (!empty($UserName)) { 
        // Besides being logged in, you may restrict access to only certain users based on an ID established when they login. 
        // Parse the strings into arrays. 
        $arrUsers = Explode(",", $strUsers); 
        $arrGroups = Explode(",", $strGroups); 
        if (in_array($UserName, $arrUsers)) { 
          $isValid = true; 
        } 
        // Or, you may restrict access to only certain users based on their username. 
        if (in_array($UserGroup, $arrGroups)) { 
          $isValid = true; 
        } 
        if (($strUsers == "") && true) { 
          $isValid = true; 
        } 
      } 
      return $isValid; 
    }
     
    $MM_restrictGoTo = "index.php";
    if (!((isset($_SESSION['MM_Username'])) && (isAuthorized("",$MM_authorizedUsers, $_SESSION['MM_Username'], $_SESSION['MM_UserGroup'])))) {   
      $MM_qsChar = "?";
      $MM_referrer = $_SERVER['PHP_SELF'];
      if (strpos($MM_restrictGoTo, "?")) $MM_qsChar = "&";
      if (isset($_SERVER['QUERY_STRING']) && strlen($_SERVER['QUERY_STRING']) > 0) 
      $MM_referrer .= "?" . $_SERVER['QUERY_STRING'];
      $MM_restrictGoTo = $MM_restrictGoTo. $MM_qsChar . "accesscheck=" . urlencode($MM_referrer);
      header("Location: ". $MM_restrictGoTo); 
      exit;
    }
    ?>
    <?php
    if (!function_exists("GetSQLValueString")) {
    function GetSQLValueString($theValue, $theType, $theDefinedValue = "", $theNotDefinedValue = "") 
    {
      if (PHP_VERSION < 6) {
        $theValue = get_magic_quotes_gpc() ? stripslashes($theValue) : $theValue;
      }
     
      $theValue = function_exists("mysql_real_escape_string") ? mysql_real_escape_string($theValue) : mysql_escape_string($theValue);
     
      switch ($theType) {
        case "text":
          $theValue = ($theValue != "") ? "'" . $theValue . "'" : "NULL";
          break;    
        case "long":
        case "int":
          $theValue = ($theValue != "") ? intval($theValue) : "NULL";
          break;
        case "double":
          $theValue = ($theValue != "") ? doubleval($theValue) : "NULL";
          break;
        case "date":
          $theValue = ($theValue != "") ? "'" . $theValue . "'" : "NULL";
          break;
        case "defined":
          $theValue = ($theValue != "") ? $theDefinedValue : $theNotDefinedValue;
          break;
      }
      return $theValue;
    }
    }
     
    if (!function_exists("GetSQLValueString")) {
    function GetSQLValueString($theValue, $theType, $theDefinedValue = "", $theNotDefinedValue = "") 
    {
      if (PHP_VERSION < 6) {
        $theValue = get_magic_quotes_gpc() ? stripslashes($theValue) : $theValue;
      }
     
      $theValue = function_exists("mysql_real_escape_string") ? mysql_real_escape_string($theValue) : mysql_escape_string($theValue);
     
      switch ($theType) {
        case "text":
          $theValue = ($theValue != "") ? "'" . $theValue . "'" : "NULL";
          break;    
        case "long":
        case "int":
          $theValue = ($theValue != "") ? intval($theValue) : "NULL";
          break;
        case "double":
          $theValue = ($theValue != "") ? doubleval($theValue) : "NULL";
          break;
        case "date":
          $theValue = ($theValue != "") ? "'" . $theValue . "'" : "NULL";
          break;
        case "defined":
          $theValue = ($theValue != "") ? $theDefinedValue : $theNotDefinedValue;
          break;
      }
      return $theValue;
    }
    }
     
    $colname_clients = "-1";
    if (isset($_SESSION['MM_Username'])) {
      $colname_clients = $_SESSION['MM_Username'];
    }
    mysql_select_db($database_local, $local);
    $query_clients = sprintf("SELECT * FROM clients WHERE nom = %s", GetSQLValueString($colname_clients, "text"));
    $clients = mysql_query($query_clients, $local) or die(mysql_error());
    $row_clients = mysql_fetch_assoc($clients);
    $totalRows_clients = mysql_num_rows($clients);
     
    $colname_suivi = "-1";
    if (isset($_GET['motdepasse'])) {
      $colname_suivi = $_GET['motdepasse'];
    }
    mysql_select_db($database_local, $local);
    $query_suivi = sprintf("SELECT * FROM clients WHERE motdepasse = %s", GetSQLValueString($colname_suivi, "text"));
    $suivi = mysql_query($query_suivi, $local) or die(mysql_error());
    $row_suivi = mysql_fetch_assoc($suivi);
     
    $colname_suivi = "-1";
    if (isset($_GET['motdepasse'])) {
      $colname_suivi = $_GET['motdepasse'];
    }
    mysql_select_db($database_local, $local);
    $query_suivi = sprintf("SELECT * FROM clients WHERE motdepasse = %s", GetSQLValueString($colname_suivi, "text"));
    $suivi = mysql_query($query_suivi, $local) or die(mysql_error());
    $row_suivi = mysql_fetch_assoc($suivi);
     
    $query_suivi = "SELECT * FROM clients WHERE nom = 'nom'";
    $suivi = mysql_query($query_suivi, $local) or die(mysql_error());
    $row_suivi = mysql_fetch_assoc($suivi);
    $totalRows_suivi = mysql_num_rows($suivi);
     
    $colname_suivi = "-1";
    if (isset($_SESSION['nom'])) {
      $colname_suivi = $_SESSION['nom'];
    }
    mysql_select_db($database_local, $local);
    $query_suivi = sprintf("SELECT * FROM clients WHERE nom = %s", GetSQLValueString($colname_suivi, "text"));
    $suivi = mysql_query($query_suivi, $local) or die(mysql_error());
    $row_suivi = mysql_fetch_assoc($suivi);
     
    $colname_suivi = "-1";
    if (isset($_GET['nom'])) {
      $colname_suivi = $_GET['nom'];
    }
    mysql_select_db($database_local, $local);
    $query_suivi = sprintf("SELECT * FROM clients WHERE nom = %s", GetSQLValueString($colname_suivi, "text"));
    $suivi = mysql_query($query_suivi, $local) or die(mysql_error());
    $row_suivi = mysql_fetch_assoc($suivi);
    ?>
    <!doctype html>
    <html>
    <head>
    <meta charset="utf-8">
    <title>Suivi</title>
    <link href="../style/reset.css" rel="stylesheet" type="text/css">
    <link href="../style/css page.css" rel="stylesheet" type="text/css">
    <link href="style/style suivi.css" rel="stylesheet" type="text/css">
    </head>
    <body>
    <div class="header">
    	<img src="../images/batideal.jpg" width="156" height="155" alt="batideal">
    </div>
    <div class="centre">
    <p>Poussez la porte de la concrétisation de vos projets du bâtiment.</p>
    <br>
    <p></p>
    <br><br><br><br>
    <form action="" method="POST">
        <table width="400px" border="0">
      <tr>
        <td>Nom :</td>
        <td><?php echo $row_clients['nom']; ?></td>
      </tr>
      <tr>
        <td>&nbsp;</td>
        <td>&nbsp;</td>
      </tr>
      <tr>
        <td>Mot de passe :</td>
        <td><?php echo $row_clients['motdepasse']; ?></td>
      </tr>
      <tr>
        <td>&nbsp;</td>
        <td>&nbsp;</td>
      </tr>
      <tr>
        <td>&nbsp;</td>
        <td>&nbsp;</td>
      </tr>
    </table>
     
    </form>
    </div>
    </body>
    </html>
    <?php
    mysql_free_result($clients);
    ?>

  5. #5
    Invité
    Invité(e)
    Par défaut [résolu]
    Merci beaucoup, ça marche


Discussions similaires

  1. [MySQL] Interface d'administration pour un client
    Par diden138 dans le forum PHP & Base de données
    Réponses: 8
    Dernier message: 23/05/2007, 00h18
  2. Code VBA pour calcul compte client > ou < à 100- Urgent
    Par mabeatrice@yahoo.fr dans le forum Requêtes et SQL.
    Réponses: 1
    Dernier message: 13/03/2007, 16h39
  3. Erreur 403 pour un compte client
    Par Fabster dans le forum Langage
    Réponses: 1
    Dernier message: 17/08/2006, 12h49
  4. [musique] création d'une interface pour se simplifier la vie
    Par Christophe93250 dans le forum Access
    Réponses: 8
    Dernier message: 08/01/2006, 12h21
  5. [FPDF] création d'un interface pour accés à des fichiers PDF
    Par StyleXP dans le forum Bibliothèques et frameworks
    Réponses: 1
    Dernier message: 19/12/2005, 10h18

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