Sunday, November 30, 2025
HomePHPConsumer Registration and Login utilizing PHP and PostgreSQL

Consumer Registration and Login utilizing PHP and PostgreSQL


<?php embrace(‘contains/dbconnection.php’);

if(isset($_POST[‘submit’]))

  {

    $fname=$_POST[‘fname’];

    $contno=$_POST[‘contactno’];

    $e-mail=$_POST[’email’];

    $password=md5($_POST[‘password’]);

    $ret=pg_query($conn,“choose Electronic mail from tblemployees the place Electronic mail=”$e-mail” OR  MobileNumber=”$contno””);

    $outcome=pg_num_rows($ret);

    if($outcome>0){

echo “<script>alert(‘This e-mail or Contact Quantity already related to one other account’);</script>”;

    }

    else{

$question = pg_query($conn, “INSERT INTO tblemployees (FullName, MobileNumber, Electronic mail, Password) VALUES (‘$fname’, ‘$contno’, ‘$e-mail’, ‘$password’)”);

        if ($question) {

    echo “<script>alert(‘You’ve got efficiently registered’);</script>”;

    echo “<script>window.location.href=”https://phpgurukul.com/user-registration-and-login-using-php-and-postgresql/signin.php”</script>”;

  }

  else

    {

      echo “<script>alert(‘One thing Went Incorrect. Please strive once more’);</script>”;

       echo “<script>window.location.href=”https://phpgurukul.com/user-registration-and-login-using-php-and-postgresql/index.php”</script>”;

    }

}

}

?>

<!DOCTYPE html>

<html lang=“en”>

<head>

    <title>Signal Up Web page</title>

    <! Icons font CSS>

    <hyperlink href=“https://phpgurukul.com/user-registration-and-login-using-php-and-postgresql/vendor/mdi-font/css/material-design-iconic-font.min.css” rel=“stylesheet” media=“all”>

    <hyperlink href=“vendor/font-awesome-4.7/css/font-awesome.min.css” rel=“stylesheet” media=“all”>

    <! Font particular for pages>

    <hyperlink href=“https://fonts.googleapis.com/css?household=Roboto:100,100i,300,300i,400,400i,500,500i,700,700i,900,900i” rel=“stylesheet”>

    <! Vendor CSS>

    <hyperlink href=“vendor/select2/select2.min.css” rel=“stylesheet” media=“all”>

    <hyperlink href=“vendor/datepicker/daterangepicker.css” rel=“stylesheet” media=“all”>

 

    <! Essential CSS>

    <hyperlink href=“css/most important.css” rel=“stylesheet” media=“all”>

</head>

<physique>

    <div class=“page-wrapper bg-blue p-t-100 p-b-100 font-robo”>

        <div class=“wrapper wrapper–w680”>

            <div class=“card card-1”>

                <div class=“card-heading”></div>

                <div class=“card-body”>

                    <h2 class=“title”>Registration Kind</h2>

                    <kind technique=“POST”>

                        <div class=“input-group”>

                         <enter class=“input–style-1” kind=“textual content” placeholder=“NAME” identify=“fname” required=“true”>

                        </div>

                        <div class=“row row-space”>

                            <div class=“col-2”>

                                <div class=“input-group”>

                                    <enter class=“input–style-1” kind=“textual content” placeholder=“Cell Quantity” identify=“contactno” required=“true” maxlength=“10” sample=“[0-9]+”>

                                </div>

                            </div>

                        

                        </div>

                        <div class=“input-group”>

                            <div class=“rs-select2 js-select-simple select–no-search”>

                               <enter class=“input–style-1” kind=“e-mail” placeholder=“Electronic mail Handle” identify=“e-mail” required=“true”>

                              

                            </div>

                        </div>

                        <div class=“row row-space”>

                            <div class=“col-2”>

                                <div class=“input-group”>

                                    <enter kind=“password” worth=“” class=“input–style-1” identify=“password” required=“true” placeholder=“Password”>

                                </div>

                            </div>

                        </div>

                        <div class=“p-t-20”>

                            <button class=“btn btn–radius btn–green” kind=“submit” identify=“submit”>Submit</button>

                        </div>

                        <br>

                        <a href=“https://phpgurukul.com/user-registration-and-login-using-php-and-postgresql/signin.php” type=“colour: pink”>Already have an account? Signin</a>

                    </kind>

                </div>

            </div>

        </div>

    </div>

 

    <! Jquery JS>

    <script src=“vendor/jquery/jquery.min.js”></script>

    <! Vendor JS>

    <script src=“vendor/select2/select2.min.js”></script>

    <script src=“vendor/datepicker/second.min.js”></script>

    <script src=“vendor/datepicker/daterangepicker.js”></script>

 

    <! Essential JS>

    <script src=“js/world.js”></script>

 

</physique><! This templates was made by Colorlib (https://colorlib.com) –>

</html>

<! finish doc>

 

RELATED ARTICLES

LEAVE A REPLY

Please enter your comment!
Please enter your name here

Most Popular

Recent Comments