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<?php require_once('Connections/con_usuarios.php'); ?>
<?php
function GetSQLValueString($theValue, $theType, $theDefinedValue = "", $theNotDefinedValue = "")
{
if (PHP_VERSION < 6) {
}
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;
}
}
?>
<?php
// *** Validate request to login to this site.
}
$loginFormAction = $_SERVER['PHP_SELF'];
if (isset($_GET['accesscheck'])) { $_SESSION['PrevUrl'] = $_GET['accesscheck'];
}
if (isset($_POST['nombre'])) { $loginUsername=$_POST['nombre'];
$password=$_POST['password'];
$MM_fldUserAuthorization = "control";
$MM_redirectLoginSuccess = "acceso.php";
$MM_redirectLoginFailed = "error.php";
$MM_redirecttoReferrer = false;
$LoginRS__query=sprintf("SELECT nombre_user, password, control FROM usuarios WHERE nombre_user=%s AND password=%s", GetSQLValueString($loginUsername, "text"), GetSQLValueString($password, "text"));
if ($loginFoundUser) {
//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 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"><!-- InstanceBegin template="/Templates/base.dwt.php" codeOutsideHTMLIsLocked="false" -->
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<!-- InstanceBeginEditable name="doctitle" -->
<title>.::Bienvenidos::.</title>
<!-- InstanceEndEditable -->
<style type="text/css">
<!--
body {
margin-top: 0px;
background-image: url(fondo.jpg);
background-repeat: repeat-x;
}
-->
</style>
<!-- InstanceBeginEditable name="head" -->
<script type="text/javascript">
<!--
function MM_validateForm() { //v4.0
if (document.getElementById){
var i,p,q,nm,test,num,min,max,errors='',args=MM_validateForm.arguments;
for (i=0; i<(args.length-2); i+=3) { test=args[i+2]; val=document.getElementById(args[i]);
if (val) { nm=val.name; if ((val=val.value)!="") {
if (test.indexOf('isEmail')!=-1) { p=val.indexOf('@');
if (p<1 || p==(val.length-1)) errors+='- '+nm+' must contain an e-mail address.\n';
} else if (test!='R') { num = parseFloat(val);
if (isNaN(val)) errors+='- '+nm+' must contain a number.\n';
if (test.indexOf('inRange') != -1) { p=test.indexOf(':');
min=test.substring(8,p); max=test.substring(p+1);
if (num<min || max<num) errors+='- '+nm+' must contain a number between '+min+' and '+max+'.\n';
} } } else if (test.charAt(0) == 'R') errors += '- '+nm+' is required.\n'; }
} if (errors) alert('The following error(s) occurred:\n'+errors);
document.MM_returnValue = (errors == '');
} }
//-->
</script>
<!-- InstanceEndEditable -->
</head>
<body>
<tr>
<td align="center" bgcolor="#FFFFFF"><!-- InstanceBeginEditable name="contenido" -->
<form id="form1" name="form1" method="POST" action="<?php echo $loginFormAction; ?>">
<center> <img src="imagenes/entrada1.jpg" width="700" height="200" /> </center>
<table width="80" border="1" align="center">
<tr>
<td><img src="imagenes/nm.jpg" width="96" height="31" /></td>
<td align="left"><input name="nombre" type="text" id="nombre" size="40" /></td>
</tr>
<tr>
<td><img src="imagenes/cs.jpg" width="92" height="29" /></td>
<td align="left"><input name="password" type="password" id="password" size="40" /></td>
</tr>
<tr>
<td align="center"> <input name="button" type="submit" id="button" onclick="MM_validateForm('nombre','','R','password','','R');return document.MM_returnValue" value="Ingresar" /></td>
</tr>
</table>
<p><a href="nuevo_usuario.php"><img src="imagenes/rfs.jpg" width="233" height="57" align="right" /></a></p>
</form>
<p><center><img src="imagenes/tds.jpg" width="774" height="243" /></center></p>
<!-- InstanceEndEditable --></td>
</tr>
</table>
</body>
<!-- InstanceEnd --></html>
DE ANTE MANO GRACIAS.