Ver Mensaje Individual
  #1 (permalink)  
Antiguo 29/05/2013, 10:37
Cydrex
 
Fecha de Ingreso: febrero-2013
Mensajes: 20
Antigüedad: 11 años, 2 meses
Puntos: 0
¿Porque me sale error en la variable?

Aquí os dejo mi Index.php y Login.php para que veáis...

Index.php:
Código:
<html>
<head>
<title>Chalice</title>
</head>
<body>
<form action="Login.php" method="post">
<h1>Iniciar sesion</h1>
Ingresa tu nick:
<input type="text" name="login"><br>
Ingresa tu contraseña:
<input type="password" name="pass"><br>
<input type="submit" value="Login"><br>
</form>
<form action="Reg.php" method="post">
<h1>Registrate</h1>
<form action="Reg.php" method="post">
Ingresa tu nick:
<input type="text" name="login"><br>
Ingresa tu contraseña:
<input type="password" name="pass"><br>
Ingresa tu email:
<input type="text" name="mail"><br>
Selecciona tu imperio:
<select name="imperio">
<option value="1">Rojo</option>
<option value="2">Verde</option>
<option value="3">Azul</option>
</select>
<br>
<input type="submit" value="Registrar"><br>
<br>
<br>
<?php 
$con=mysql_connect("localhost","root","") or
  die("Problemas en la conexion");
mysql_select_db("Chalice",$con) or
  die("Problemas en la selección de la base de datos");
$registros=mysql_query("select count(*) as cantidad 
                         from usuarios",$con) or
  die("Problemas en el select:".mysql_error());
$reg=mysql_fetch_array($registros);
echo "<font color='red'>¡Ya somos ".$reg['cantidad']," usuarios!</font>";
 ?>
</form>
</body>
</html>
Login.php:
Código:
<?php
 
 $con=mysql_connect("localhost","root","") 
 or die("Problemas con la conexion a la db, revisa los datos");
 mysql_select_db("chalice",$con)
  or die("Problemas en la seleccion de la base de datos");
 mysql_query("select from usuarios where login="$_REQUEST[login]"",$con);
   or die ("Problemas en el select".mysql_error());
   mysql_close($con);
 
?>