Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <?php
- if(isset($_POST['registro']))
- {
- if(($_POST['nick']!='') && ($_POST['mail']!='') && ($_POST['pass']!='') && ($_POST['conf_pass']!=''))
- {
- if($_POST['pass']!=$_POST['conf_pass'])
- {
- echo '<br /><font color=red><img src="Imagenes/error.png" />¡Las contraseñas no coinciden!</font>';
- }
- else
- {
- $nick= limpiar($_POST['nick']);
- $telf= limpiar($_POST['telf']);
- $mail= limpiar($_POST['mail']);
- $email=$_POST["mail"];
- $pass= limpiar($_POST['pass']);
- $b_user= mysql_query("SELECT Nick FROM usuarios WHERE Nick='$nick'");
- $b_mail= mysql_query("Select Email from usuarios where Email='$mail'");
- if($user=@mysql_fetch_array($b_user) || $mail=@mysql_fetch_array($b_mail))
- {
- echo '<br /><font color=red><img src="Imagenes/error.png" />¡El nombre de usuario o el email ya esta registrado!.</font>';
- mysql_free_result($b_user);
- mysql_free_result($b_mail);
- }
- else
- {
- if(isset($nick))
- {
- if(validar_email($_POST['mail']))
- {
- if(!isset($telf) || strlen($telf)!=9)
- {
- echo'<br /><font color=red><img src="Imagenes/error.png" />¡Debes introducir un teléfono válido!.</font>';
- }
- else
- {
- mysql_query("INSERT INTO usuarios set Nick='$nick', Telefono='$telf',Email='$email', Pass='$pass'")or die(mysql_error());
- echo '<br /><font color=green><img src="Imagenes/success.png" />¡Te has registrado correctamente, ahora podras iniciar sesión como usuario registrado!.</font>';
- }
- }
- else
- {
- echo '<br /><font color=red><img src="Imagenes/error.png" />¡El email no es válido!.</font>';
- }
- }
- else
- {
- echo'<br /><font color=red><img src="Imagenes/error.png" />¡Debes introducir un Nick!.</font>';
- }
- }
- }
- }
- else
- {
- echo '<br /><font color=red><img src="Imagenes/error.png" />¡Deberás rellenar todos los campos!.</font>';
- }
- }
- ?>
- <form name="registrar" method="post" onSubmit="return validar()" />
- <table>
- <tr>
- <td>Nombre: </td>
- <td><input class="textinput" type='text' name='nick' size="25" /></td>
- </tr>
- <tr>
- <td>E-mail:</td>
- <td><input class="textinput" type='text' name='mail' size="25" /></td>
- </tr>
- <td>Teléfono:</td>
- <td><input class="textinput" type='text' name='telf' size="25" /></td>
- </tr>
- <tr>
- <td>Password:</td>
- <td><input class="textinput" type="password" name='pass' size="25" /></td>
- </tr>
- <tr>
- <td>Confirmar Password:</td>
- <td><input class="textinput" type="password" name='conf_pass' size="25" /></td>
- </tr>
- <tr>
- <td><input class="button" type="reset" name="Limpiar" style="width:100px;" value="Limpiar" /></td>
- <td><input class="button" type="submit" name="registro" style="width:100px;" value="Registrar" /></td>
- </tr>
- </table>
- </form>
Add Comment
Please, Sign In to add comment