Untitled

mail@pastecode.io avatar
unknown
plain_text
21 days ago
662 B
1
Indexable
Never
<?php
    $conn = mysqli_connect("localhost", "root", "", "sa23128422","3308");
    if (!$conn) {
        die("Sorry");
    }
    if (isset($_POST["register"])) {
        $txtName = $_POST["txtName"];
        $txtEmail = $_POST["txtEmail"];
        $txtPassword = $_POST["txtPassword"];
        $txtContactNo = $_POST["txtContactNo"];
        $sql = "INSERT INTO users VALUES ('$txtName', '$txtEmail', '$txtPassword', '$txtContactNo')";
        $query = mysqli_query($conn, $sql);
        if ($query) {
            echo "Success...<script>window.location.href='login.php';</script>";
        }else {
            echo "Error";
        }
    }
?>
Leave a Comment