FORUM Tom's Hardware » Programmation » HTML / Javascript » Pbl déconnexion d'un utilisateur
 

Pbl déconnexion d'un utilisateur

Il y a 267 utilisateurs connus et inconnus. Pour voir la liste des connectés connus, cliquez ici
Ajouter une réponse



 Mot :   Pseudo :  
 
Bas de page
Auteur
 Sujet : Pbl déconnexion d'un utilisateur
 
Plus d'informations

Bonjour ! Je reviens vers vous avec une mise en page avec calque ...
 
Mais mon problème n'est pas là
Cette partie me pose problème : impossible de déconnecter l'utilisateur avec le lien déconnexion ...
 
 

Code :
  1. <?php require('Connections/locale.php'); ?>
  2. <?php
  3. if (!function_exists("GetSQLValueString" )) {
  4. function GetSQLValueString($theValue, $theType, $theDefinedValue = "", $theNotDefinedValue = "" )
  5. {
  6.   $theValue = get_magic_quotes_gpc() ? stripslashes($theValue) : $theValue;
  7.   $theValue = function_exists("mysql_real_escape_string" ) ? mysql_real_escape_string($theValue) : mysql_escape_string($theValue);
  8.   switch ($theType) {
  9.     case "text":
  10.       $theValue = ($theValue != "" ) ? "'" . $theValue . "'" : "NULL";
  11.       break;   
  12.     case "long":
  13.     case "int":
  14.       $theValue = ($theValue != "" ) ? intval($theValue) : "NULL";
  15.       break;
  16.     case "double":
  17.       $theValue = ($theValue != "" ) ? "'" . doubleval($theValue) . "'" : "NULL";
  18.       break;
  19.     case "date":
  20.       $theValue = ($theValue != "" ) ? "'" . $theValue . "'" : "NULL";
  21.       break;
  22.     case "defined":
  23.       $theValue = ($theValue != "" ) ? $theDefinedValue : $theNotDefinedValue;
  24.       break;
  25.   }
  26.   return $theValue;
  27. }
  28. }
  29. ?>
  30. <?php
  31. // *** Validate request to login to this site.
  32. if (!isset($_SESSION)) {
  33.   session_start();
  34. }
  35. $loginFormAction = $_SERVER['PHP_SELF'];
  36. if (isset($_GET['accesscheck'])) {
  37.   $_SESSION['PrevUrl'] = $_GET['accesscheck'];
  38. }
  39. if (isset($_POST['login'])) {
  40.   $loginUsername=$_POST['login'];
  41.   $password=$_POST['motdepasse'];
  42.   $MM_fldUserAuthorization = "";
  43.   $MM_redirectLoginSuccess = "/perso.php";
  44.   $MM_redirectLoginFailed = "/loginerror.php";
  45.   $MM_redirecttoReferrer = false;
  46.   mysql_select_db($database_locale, $locale);
  47.  
  48.   $LoginRS__query=sprintf("SELECT login, passe FROM membre WHERE login=%s AND passe=%s",
  49.     GetSQLValueString($loginUsername, "text" ), GetSQLValueString($password, "text" ));
  50.  
  51.   $LoginRS = mysql_query($LoginRS__query, $locale) or die(mysql_error());
  52.   $loginFoundUser = mysql_num_rows($LoginRS);
  53.   if ($loginFoundUser) {
  54.      $loginStrGroup = "";
  55.    
  56.     //declare two session variables and assign them
  57.     $_SESSION['MM_Username'] = $loginUsername;
  58.     $_SESSION['MM_UserGroup'] = $loginStrGroup;         
  59.     if (isset($_SESSION['PrevUrl']) && false) {
  60.       $MM_redirectLoginSuccess = $_SESSION['PrevUrl'];
  61.     }
  62.     header("Location: " . $MM_redirectLoginSuccess );
  63.   }
  64.   else {
  65.     header("Location: ". $MM_redirectLoginFailed );
  66.   }
  67. }
  68. ?>
  69. <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
  70. <html xmlns="http://www.w3.org/1999/xhtml">
  71. <head>
  72. <meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" />
  73. <title>modele2</title>
  74. <link href="../css/principal2.css" rel="stylesheet" type="text/css" />
  75. </head>
  76. <body>
  77. <div id="titre"><img src="/images/serma_gr_bandeau_v2.jpg" alt="banner" width="800" height="150" /></div>
  78. <div id="Login">
  79.     <?php
  80.         if(isset($_SESSION['MM_Username']))
  81.         {
  82.             echo "Bonjour ". $_SESSION['MM_Username'] ;
  83.             echo "<a href='$logoutAction'>Déconnexion</a></p>";
  84.         }
  85.         else
  86.         {
  87.     ?>
  88.   <form id="autentifi" method="POST" action="<?php echo $loginFormAction; ?>">
  89.     <table border="0" cellpadding="0" cellspacing="0" class="barrelogin">
  90.       <tr>
  91.         <td width="51">Login : </td>
  92.         <td width="145"><input name="login" type="text" id="login" /></td>
  93.         <td width="80">Password : </td>
  94.         <td width="145"><input name="motdepasse" type="text" id="motdepasse" /></td>
  95.         <td width="61"><input name="valide" type="submit" id="valide" value="Envoyer" /></td>
  96.       </tr>
  97.     </table>
  98.     <?php } ?>
  99.   </form>
  100. </div>
  101. <div id="Centre">
  102.     <div id="navigation">
  103.       <table width="160" border="0" cellspacing="0" cellpadding="0">
  104.         <tr>
  105.           <td class="MenuH">Aides et<br />
  106.           proc&eacute;dures : </td>
  107.         </tr>
  108.         <tr>
  109.           <td class="Menu"><p>Recherche par<br />
  110.             cath&eacute;gories : </p>
  111.           </td>
  112.         </tr>
  113.         <tr>
  114.           <td class="Menu">Recherche par<br />
  115.   mot cl&eacute; : </td>
  116.         </tr>
  117.         <tr>
  118.           <td class="Menu">Proc&eacute;dure en vid&eacute;o : </td>
  119.         </tr>
  120.         <tr>
  121.           <td class="Menu"><a href="/forum.php">Forum</a></td>
  122.         </tr>
  123.         <tr>
  124.           <td class="Menu">administration</td>
  125.         </tr>
  126.       </table>
  127.   </div>
  128.     <div id="Menuhaut"><a href="/index.php">Accueil</a> - <a href="/forum.php">Forum</a> - <a href="/aides.php">Aides</a> - <a href="/videos.php">Vid&eacute;os</a> - <a href="/telechargements.php">T&eacute;l&eacute;chargements</a> </div>
  129.   <div id="contenu"><!-- TemplateBeginEditable name="contenu" --><!-- TemplateEndEditable --></div>
  130. </div>
  131. <p>&nbsp;</p>
  132. <p>&nbsp;</p>
  133. <p>&nbsp;</p>
  134. </body>
  135. </html>


Merci pour le coup de main ^^'

Profil : Pointeur
Plus d'informations

vu que tu définis pas $logoutAction ...


---------------
Da Bidz Triad©®™: Bidz Interceptor
.:: Smileyz version 4.2 [050625]::. -- Code source disponible sous licence GPL.
[u

Aller à :
Ajouter une réponse
  FORUM Tom's Hardware » Programmation » HTML / Javascript » Pbl déconnexion d'un utilisateur
 

Annonces Google
Publicité