<?php

    $name = $email = $password = $repeatpass = '';

    $name = $_POST['name'];
    $email = $_POST['email'];
    $password = $_POST['password'];
    $repeatpass = $_POST['repeatpass'];

    $con = new mysqli(DB_HOST, DB_USER, DB_PASSWORD, DB_NAME);

    $sql = "INSERT INTO user-regis (name, email, password, repeatpass) VALUES ('$name', '$email', '$password', '$repeatpass')";
    $result = $con->query($sql);
    if (!$result) {
        header("Location: login.php");
    } else {
        echo "Error :" . $sql;
    }
    ?>

Can you please explain what you're trying to do that isn't working? You're saying data is not coming out? Coming out of what? You are trying to insert a row into the table, correct? Are you sure that the connection is able to successfully be established?

Also, always escape your values before passing them into a MySQL query with real_escape_string().

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.