
13/02/2011, 13:23
|
| | Fecha de Ingreso: septiembre-2009
Mensajes: 4
Antigüedad: 15 años, 6 meses Puntos: 0 | |
Problemas con mi php de conexion Hola que tal amigos del foro bueno miren el problema es este tengo mi codigo que mas de rato publico.....el cual no puedo hacer que entre a con el usuario y la contraseña que ya estableci la verdad seria de mucha ayuda que e hecharan la mano porfas
Aqui les dejo el codigo que tengo
<!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=utf-8" />
<title>Sedesol</title>
<?php
$msj="";
require_once("conexion/acn.php");
mysql_select_db($database_mysql,$mysql);
$editorServidor = $_SERVER['PHP_SELF'];
if(isset($_SERVER['QUERY_STRING'])){
$editorServidor .="?" .htmlentities($_SERVER['QUERY_STRING']);
}
if(isset($_POST['enviar']) && $_POST['enviar']=="Enviar"){
if($_POST['id']<>"" && $_POST['pwd']<>""){
$consulta=mysql_query("select usr,pwd from usuarios where usr='".trim($_POST['id'])."' and pwd ='".trim($_POST['pwd'])."'",$mysql) or die(mysql_error());
if(mysql_num_rows($consulta)>1){
if(strcmp(trim($_POST['pwd']),trim(mysql_result($consulta,0,1)))==0 && $_POST['id']==mysql_result($consulta,0,0)){
}else{
$msj="Error de usuario y/o contraseña";
}
}
else{
$msj= "Usuario inexistente";
}
}else{
$msj= "Llene todos los campos";
}
}
?>
<style type="text/css">
body {
background-image: url(fnd.png);
}
#apDiv1 {
position:absolute;
width:718px;
height:459px;
z-index:1;
left: 20%;
top: 53px;
background-color: #996666;
}
</style>
</head>
<body>
<div id="apDiv1">
<form id="acceso" name="acceso" method="post" action="<?php $editorServidor ?>" >
<p> </p>
<table width="367" border="1" align="center">
<tr align="right">
<td> Nombre :
<label for="id"></label>
<input type="text" name="id" id="id" /></td>
</tr>
<tr>
<td align="right">Contraseña :
<label for="pwd"></label>
<input type="password" name="pwd" id="pwd" /></td>
</tr>
<tr align="center">
<td><input type="submit" name="enviar" id="enviar" value="Enviar" /></td>
</tr>
</table>
<p align="center"> <?php echo $msj;?> </p>
<p> </p>
</form>
</div>
<p> </p>
</body>
</html> |