Ver Mensaje Individual
  #1 (permalink)  
Antiguo 31/05/2013, 22:05
Avatar de nexus44
nexus44
 
Fecha de Ingreso: octubre-2012
Ubicación: Piura
Mensajes: 108
Antigüedad: 11 años, 6 meses
Puntos: 1
Ayuda con mi Acceso login

Buenas noches amigos tengo una consulta vista previa quisiera que me ayuden se los agradeceria muchisimo estado indagando pero hasta el momento no encontrado la solucion respecto a este problema que tengo.

Estado elaborando un login (acceso) bueno lo que pasa con este login que al momento que yo quiero acceder al login ; Me registre con ID : oscar Clave: car123 entonces cual viene hacer el problema , que si yo colocara de ID : OSCAR y clave : CAR123 , con letras mayusculas tambien me deja entrar , pero lo que yo quisiera es que no me deje entrar , si no como tal me registro yo pueda ingresar al login.

Dejo el codigo.

Código PHP:
Ver original
  1. <?php require_once('Connections/con_usuarios.php'); ?>
  2. <?php
  3. if (!function_exists("GetSQLValueString")) {
  4. function GetSQLValueString($theValue, $theType, $theDefinedValue = "", $theNotDefinedValue = "")
  5. {
  6.   if (PHP_VERSION < 6) {
  7.     $theValue = get_magic_quotes_gpc() ? stripslashes($theValue) : $theValue;
  8.   }
  9.  
  10.   $theValue = function_exists("mysql_real_escape_string") ? mysql_real_escape_string($theValue) : mysql_escape_string($theValue);
  11.  
  12.   switch ($theType) {
  13.     case "text":
  14.       $theValue = ($theValue != "") ? "'" . $theValue . "'" : "NULL";
  15.       break;    
  16.     case "long":
  17.     case "int":
  18.       $theValue = ($theValue != "") ? intval($theValue) : "NULL";
  19.       break;
  20.     case "double":
  21.       $theValue = ($theValue != "") ? doubleval($theValue) : "NULL";
  22.       break;
  23.     case "date":
  24.       $theValue = ($theValue != "") ? "'" . $theValue . "'" : "NULL";
  25.       break;
  26.     case "defined":
  27.       $theValue = ($theValue != "") ? $theDefinedValue : $theNotDefinedValue;
  28.       break;
  29.   }
  30.   return $theValue;
  31. }
  32. }
  33. ?>
  34. <?php
  35. // *** Validate request to login to this site.
  36. if (!isset($_SESSION)) {
  37. }
  38.  
  39. $loginFormAction = $_SERVER['PHP_SELF'];
  40. if (isset($_GET['accesscheck'])) {
  41.   $_SESSION['PrevUrl'] = $_GET['accesscheck'];
  42. }
  43.  
  44. if (isset($_POST['nombre'])) {
  45.   $loginUsername=$_POST['nombre'];
  46.   $password=$_POST['password'];
  47.   $MM_fldUserAuthorization = "control";
  48.   $MM_redirectLoginSuccess = "acceso.php";
  49.   $MM_redirectLoginFailed = "error.php";
  50.   $MM_redirecttoReferrer = false;
  51.   mysql_select_db($database_con_usuarios, $con_usuarios);
  52.    
  53.   $LoginRS__query=sprintf("SELECT nombre_user, password, control FROM usuarios WHERE nombre_user=%s AND password=%s",
  54.   GetSQLValueString($loginUsername, "text"), GetSQLValueString($password, "text"));
  55.    
  56.   $LoginRS = mysql_query($LoginRS__query, $con_usuarios) or die(mysql_error());
  57.   $loginFoundUser = mysql_num_rows($LoginRS);
  58.   if ($loginFoundUser) {
  59.    
  60.     $loginStrGroup  = mysql_result($LoginRS,0,'control');
  61.    
  62.     //declare two session variables and assign them
  63.     $_SESSION['MM_Username'] = $loginUsername;
  64.     $_SESSION['MM_UserGroup'] = $loginStrGroup;      
  65.  
  66.     if (isset($_SESSION['PrevUrl']) && false) {
  67.       $MM_redirectLoginSuccess = $_SESSION['PrevUrl']; 
  68.     }
  69.     header("Location: " . $MM_redirectLoginSuccess );
  70.   }
  71.   else {
  72.     header("Location: ". $MM_redirectLoginFailed );
  73.   }
  74. }
  75. ?>
  76. <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
  77. <html xmlns="http://www.w3.org/1999/xhtml"><!-- InstanceBegin template="/Templates/base.dwt.php" codeOutsideHTMLIsLocked="false" -->
  78. <head>
  79. <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
  80. <!-- InstanceBeginEditable name="doctitle" -->
  81. <title>.::Bienvenidos::.</title>
  82. <!-- InstanceEndEditable -->
  83. <style type="text/css">
  84. <!--
  85. body {
  86.     margin-top: 0px;
  87.     background-image: url(fondo.jpg);
  88.     background-repeat: repeat-x;
  89. }
  90. -->
  91. </style>
  92. <!-- InstanceBeginEditable name="head" -->
  93. <script type="text/javascript">
  94. <!--
  95. function MM_validateForm() { //v4.0
  96.   if (document.getElementById){
  97.     var i,p,q,nm,test,num,min,max,errors='',args=MM_validateForm.arguments;
  98.     for (i=0; i<(args.length-2); i+=3) { test=args[i+2]; val=document.getElementById(args[i]);
  99.       if (val) { nm=val.name; if ((val=val.value)!="") {
  100.         if (test.indexOf('isEmail')!=-1) { p=val.indexOf('@');
  101.           if (p<1 || p==(val.length-1)) errors+='- '+nm+' must contain an e-mail address.\n';
  102.         } else if (test!='R') { num = parseFloat(val);
  103.           if (isNaN(val)) errors+='- '+nm+' must contain a number.\n';
  104.           if (test.indexOf('inRange') != -1) { p=test.indexOf(':');
  105.             min=test.substring(8,p); max=test.substring(p+1);
  106.             if (num<min || max<num) errors+='- '+nm+' must contain a number between '+min+' and '+max+'.\n';
  107.       } } } else if (test.charAt(0) == 'R') errors += '- '+nm+' is required.\n'; }
  108.     } if (errors) alert('The following error(s) occurred:\n'+errors);
  109.     document.MM_returnValue = (errors == '');
  110. } }
  111. //-->
  112. </script>
  113. <!-- InstanceEndEditable -->
  114. </head>
  115.  
  116. <body>
  117.  
  118.   <tr>
  119.     <td align="center" bgcolor="#FFFFFF"><!-- InstanceBeginEditable name="contenido" -->
  120.      
  121.       <form id="form1" name="form1" method="POST" action="<?php echo $loginFormAction; ?>">
  122.        <center> <img src="imagenes/entrada1.jpg" width="700" height="200" />       </center>
  123.         <table width="80" border="1" align="center">
  124.           <tr>
  125.             <td><img src="imagenes/nm.jpg" width="96" height="31" /></td>
  126.             <td align="left"><input name="nombre" type="text" id="nombre" size="40" /></td>
  127.           </tr>
  128.           <tr>
  129.             <td><img src="imagenes/cs.jpg" width="92" height="29" /></td>
  130.             <td align="left"><input name="password" type="password" id="password" size="40" /></td>
  131.           </tr>
  132.           <tr>
  133.            
  134.             <td align="center"> <input name="button" type="submit" id="button" onclick="MM_validateForm('nombre','','R','password','','R');return document.MM_returnValue" value="Ingresar" /></td>
  135.           </tr>
  136.         </table>
  137.         <p><a href="nuevo_usuario.php"><img src="imagenes/rfs.jpg" width="233" height="57" align="right" /></a></p>
  138.     </form>
  139. <p><center><img src="imagenes/tds.jpg" width="774" height="243" /></center></p>
  140.  
  141.     <!-- InstanceEndEditable --></td>
  142.   </tr>
  143. </table>
  144. </body>
  145. <!-- InstanceEnd --></html>



DE ANTE MANO GRACIAS.
__________________

"Nuestra capacidad se aleja de la Humanidad"