Ver Mensaje Individual
  #1 (permalink)  
Antiguo 02/07/2013, 02:55
prototypesp
 
Fecha de Ingreso: febrero-2011
Mensajes: 9
Antigüedad: 13 años, 2 meses
Puntos: 0
Información Como crear un registro web PHP MySQL

Hola a todos tengo un web site en proceso y necesito agregar un login ya tengo y un registro lo que me hace falta.

1. tengo el archivo validar.

<?php
session_start();
$usuario = $_POST["usuario"];
$password = $_POST["password"];
include("conexion.php");
$tabla= mysql_query("SELECT * FROM usuarios WHERE login='$usuario' and password='$password'");
if($fila=mysql_fetch_array($tabla)){
$_SESSION['perfil']=$fila["perfil"];
header("Location:consulta.php");
}
else{
header("Location:index.html?msg=USUARIO NO VALIDO");
}
?>


2. formulario login.php


código


<tr>
<td height="150" align="center" class="Texto">
<div id="texto"><blockquote>

<font color="#FF0000">
<?php if(isset($_GET["msg"])) echo $_GET["msg"] ?></font><form id="form1" name="form1" method="post" action="validar.php">
<p>&nbsp;</p>
<table width="300" border="0" align="center" cellpadding="0" cellspacing="0">
<tr>
<th scope="row">Usuario:</th>
<td><label for="usuario"></label>
<input name="usuario" type="text" id="usuario" size="20" maxlength="20" /></td>
</tr>
<tr>
<th scope="row">Password:</th>
<td><label for="password"></label>
<input name="password" type="password" id="password" size="20" maxlength="20" /></td>
</tr>
<tr>
<th colspan="2" bgcolor="#CCCCCC" scope="row"><input type="submit" name="button" id="button" value="Acceder" /></th>
</tr>
</table>
<p>&nbsp;</p>
</form>
</div>
</td>
</tr>


3. Base de Datos/ tabla " usuario "

cod_usuario, nombre, login, password, perfil.


4. Después de andas buscando como loco y no encontrar. alguien me puede ayudar

agregar un registro de ellos

Registro por default con perfil invitado

Nombre
Apellidos
Teléfono
Correo Electrónico
Contraseña
Repita Contraseña

registrar

(Tendre que modificar los campos del 3)


help me,, ayuda