Ver Mensaje Individual
  #7 (permalink)  
Antiguo 19/02/2012, 04:17
nobo
 
Fecha de Ingreso: diciembre-2011
Mensajes: 151
Antigüedad: 12 años, 3 meses
Puntos: 1
Respuesta: Formulario de registro en php

Justo cree un post para eso, para concretar un poco.. Lo queria comprobar en la misma pagina. En otra pagina si sabia como...

Lo tengo asi, estaria bien?
Código PHP:
Ver original
  1. if (isset($_POST) && isset($_SERVER['HTTP_REFERER']) && $_SERVER['HTTP_REFERER'] == 'http://www.elzulo***/alta_usuario.php' && !empty($_POST)) {
  2.     $username = $_POST["strNick"];
  3.     $pass = $_POST["strPassword"];
  4.     $password = $_POST["password"];
  5.     $email = $_POST["strEmail"];
  6.     $mail = $_POST["mail"];
  7.     $telefono = $_POST["intNtelf"];
  8.     $telefono2 = $_POST["telefono"];
  9.      
  10.     $checkuser = comprobaruser($_POST["strNick"]);
  11.     $checkmail = comprobaruser($_POST["strEmail"]);
  12.      
  13.           if($pass!=$password) {
  14.              echo "Las contraseñas no coinciden"; }
  15.                 if($email!=$mail) {
  16.              echo "El email no coincide"; }
  17.          
  18.              if($telefono!=$telefono2) {
  19.              echo "Los telefonos no coinciden";
  20.           }else {
  21.              if ($checkuser !=0) {
  22.                  echo "El usuario" .$username. "ya existe"; }
  23.                  
  24.                  if ($checkmail !=0){
  25.                      echo "El mail" .$email. "ya existe"; }
  26.          
  27.           }
  28.     }else {
  29.      
  30.     if (isset($_POST["form1"])) {
  31.       $insertSQL = sprintf("INSERT INTO tblusuario (strNombre, strEmail, intActivo, strPassword, strDireccion) VALUES (%s, %s, %s, %s, %s)",
  32.                            GetSQLValueString($_POST['strNombre'], "text"),
  33.                            GetSQLValueString($_POST['strEmail'], "text"),
  34.                            GetSQLValueString($_POST['intActivo'], "int"),
  35.                            GetSQLValueString($_POST['strPassword'], "text"),
  36.                            GetSQLValueString($_POST['strDireccion'], "text"));
  37.      
  38.       mysql_select_db($database_conexionzulo, $conexionzulo);}}