Hola tengo un pequeño código de registro de usuarios pero no me esta insertando los datos en base de datos:
conexion.php
<?php
$con = new mysqli('localhost','root','','coco');
?>
formulario.php
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8">
<link rel="stylesheet" href="bootstrap/css/bootstrap.css">
<link rel="stylesheet" href="bootstrap/css/bootstrap-responsive.css">
<link rel="stylesheet" type="text/css" href="estilos/estilos.css">
<title>Registro CocoBaby</title>
</head>
<body background="images/golf.jpg" style="background-attachment: fixed" >
<center><div class="tit"><h2 style="color: #0000FF; ">Registro</h2>
<br>
<!-- formulario registro -->
<form method="post" action="" >
<fieldset>
<div class="form-group">
<label style="font-size: 14pt"><b>Ingresa tu nombre</b></label>
<input type="text" name="realname" class="form-control" placeholder="Ingresa tu nombre" />
</div>
<div class="form-group">
<label style="font-size: 14pt; color: #FFFFFF;"><b>Ingresa tu email</b></label>
<input type="text" name="nick" class="form-control" required placeholder="Ingresa mail"/>
</div>
<div class="form-group">
<label style="font-size: 14pt; color: #FFFFFF;"><b>Ingresa tu Password</b></label>
<input type="password" name="pass" class="form-control" placeholder="Ingresa contraseña" />
</div>
<div class="form-group">
<label style="font-size: 14pt"><b>Repite tu contraseña</b></label>
<input type="password" name="rpass" class="form-control" required placeholder="repite contraseña" />
</div>
</div>
<input class="btn btn-danger" type="submit" name="submit" value="Registrarse"/><br><br>
<a href="./index.php"><input class="btn btn-info" type="button" value="Ya tengo Cuenta"/></a>
</fieldset>
</form>
<?php
if(isset($_POST['submit'])){
require("./valogin/registro.php");
}
?>
<!--Fin formulario registro -->
</center>
</body>
</html>
./valogin/registro.php
<?php
$realname=$_POST['realname'];
$mail=$_POST['nick'];
$pass= $_POST['pass'];
$rpass=$_POST['rpass'];
require("conexion.php");
$checkemail=mysqli_query($con,"SELECT * FROM login WHERE email='$mail'");
$check_mail=mysqli_num_rows($checkemail);
if($pass==$rpass){
if($check_mail>0){
echo ' <script language="javascript">alert("Atencion, ya existe el mail designado para un usuario, verifique sus datos");</script> ';
}else{
mysqli_query($con,"INSERT INTO login VALUES('','$realname','$pass','$mail','','2')");
echo ' <script language="javascript">alert("Usuario registrado con éxito");</script> ';
}
}else{
echo 'Las contraseñas son incorrectas';
}
?>
¿Que estoy haciendo mal ? :(
Les agredeceria la ayuda :)
()
luego delogin
,INSERT INTO login() VALUES(' ',' ',...)