Error saving data in MySQL

1

I'm trying to write fields from my formulario to base de datos sql , and the truth, I have no idea, I've been looking around but I'm a NOOB of the total issue, can someone take a look and put me in the right direction?

Thanks

I have reached up to Error saving data and I have not been able to achieve a concrete solution.

  <?php
    //conexion con la base de datos y el servidor
    $link = mysql_connect("","","") or die("<h2>No se encuentra el servidor</h2>");
    $db = mysql_select_db("",$link) or die("<h2>Error de Conexion</h2>");

    //obtenemos los valores del formulario
    $usuario = $_POST['usuario'];
    $pass = $_POST['pass'];
    $rpass = $_POST['rpass'];
    $titular = $_POST['titular'];
    $telefono = $_POST['telefono'];
    $direccion = $_POST['direccion'];
    $movil = $_POST['movil'];
    $ciudad = $_POST['ciudad'];
    $fax = $_POST['fax'];
    $postal = $_POST['postal'];
    $correo = $_POST['correo'];
    $provincia = $_POST['provincia'];
    $web = $_POST['web'];
    $pais = $_POST['pais'];
    $contacto = $_POST['contacto'];
    $vat = $_POST['vat'];
    $vies = $_POST['vies'];

    //Obtiene la longitud de un string
    $req = (strlen($usuario)*strlen($pass)*strlen($rpass)*strlen($titular)*strlen($telefono)*strlen($direccion)*strlen($movil)*strlen($ciudad)*strlen($fax)*strlen($postal)*strlen($correo)*strlen($provincia)*strlen($web)*strlen($pais)*strlen($contacto)*strlen($vat)*strlen($vies)) or die("No se han llenado todos los campos");

    //se confirma la contraseña
    if ($pass != $rpass) {
        die('Las contraseñas no coinciden, Verifique <br /> <a href="gracias.html">Volver</a>');
    }

    //se encripta la contraseña
    $contraseñaUser = md5($pass);

    //ingresamos la informacion a la base de datos
    mysql_query("INSERT INTO clientes ('usuario','pass','titular','telefono','direccion','movil','ciudad','fax','postal','correo','provincia','web','pais','contacto','vat','vies') VALUES ('$usuario','$contraseñaUser','$titular','$telefono','$direccion','$movil','$ciudad','$fax','$postal','$correo','$provincia','$web','$pais','$contacto','$vat','$vies')",$link) or die("<h2>Error Guardando los datos</h2>");
    echo'
        <script>
            alert("Registro Exitoso");
            location.href="gracias.html";
        </script>

?>
    
asked by Tito Pricus 15.08.2018 в 13:46
source

0 answers