Ver Mensaje Individual
  #14 (permalink)  
Antiguo 16/02/2012, 17:03
nobo
 
Fecha de Ingreso: diciembre-2011
Mensajes: 151
Antigüedad: 12 años, 4 meses
Puntos: 1
Respuesta: Form action en la misma pagina

Esto 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.  
  3. $nombre = $_POST["strNombre"];
  4. $username = $_POST["strNick"];
  5. $pass = $_POST["strPassword"];
  6. $password = $_POST["password"];
  7. $email = $_POST["strEmail"];
  8. $mail = $_POST["mail"];
  9. $direccion = $_POST["strDireccion"];
  10. $cpostal = $_POST["intCpostal"];
  11. $poblacion = $_POST["strPoblacion"];
  12. $provincia = $_POST["strPovincia"];
  13. $telefono = $_POST["intNtelf"];
  14. $telefono2 = $_POST["telefono"];
  15.  
  16. $checkuser = comprobaruser($_POST["strNick"]);
  17. $checkmail = comprobaruser($_POST["strEmail"]);
  18.  
  19.       if($pass!=$password) {
  20.          echo "Las contraseñas no coinciden"; }
  21.             if($email!=$mail) {
  22.          echo "El email no coincide"; }
  23.      
  24.          if($telefono!=$telefono2) {
  25.          echo "Los telefonos no coinciden";
  26.       }else {
  27.          if ($checkuser !=0) {
  28.              echo "El usuario" .$username. "ya existe"; }
  29.              
  30.              if ($checkmail !=0){
  31.                  echo "El mail" .$email. "ya existe"; }
  32.      
  33.       }
  34. }else {
  35.  
  36. if (isset($_POST["form1"])) {
  37.   $insertSQL = sprintf("INSERT INTO tblusuario (strNombre, strEmail, intActivo, strPassword, strDireccion) VALUES (%s, %s, %s, %s, %s)",
  38.                        GetSQLValueString($_POST['strNombre'], "text"),
  39.                        GetSQLValueString($_POST['strEmail'], "text"),
  40.                        GetSQLValueString($_POST['intActivo'], "int"),
  41.                        GetSQLValueString($_POST['strPassword'], "text"),
  42.                        GetSQLValueString($_POST['strDireccion'], "text"));
  43.  
  44.   mysql_select_db($database_conexionzulo, $conexionzulo);}}