Friday, May 25, 2018

Registration and login form in php and mysql with validation

Registration and login form in php and mysql with validation :

Hello Friend मेरा नाम दीपेन्द्र बघेल है में आप के लिए एक इस post में  एक mini Project ले कर आया हु | आज के इस post में हम देखेगे की  किस तरह से एक login and Registration System php का use  कर के  किस तरह से बनाया जा सकता है 

इस Project में हम एक login and Registration System php का use करते हुए बनाएगे  जिसमे हम एक sign Up Page बनाएगे जिसका use कर के user का  Registration किया जाएगा 
इसके आलावा  एक login page बनाया जाएगा जिसका use कर user login करेगा 

Registration and login form mini Project की विशेषता :

 1. इस प्रोजेक्ट में हम सभी text Field और input control पर Validation लगाएगे जिसके कारन user उस text फील्ड को खाली नहीं छोड़ सकता है यदि user text Field को user खाली छोड़ेगा तो use error Message Display किया जाएगा 

2. इस प्रोजेक्ट में हम session का use करेगे session का use करने से हमारा login system सिक्योर हो जाएगा | session का use करने के कारन यदी कोई user अपना Logout कर देता है तो use Account को दोबारा open करने के लिए use फिर से user name और password देना होगा 

3. इस प्रोजेक्ट में आपको इसके source code Download करने की सुविधा दी जाएगी

4. इस Blog के आलावा आपको इस project के लिए video Tutorial hindi Language में Provide किये जाएगे

 Environment Setup  For This Project 

 

Login And Registration System in php Video Tutorial Part 1



Login And Registration System in php Video Tutorial Part 2

 

Login And Registration System in php Video Tutorial Part 3

 

Login And Registration System in php Video Tutorial Part 4

 

Login And Registration System in php Video Tutorial Part 5

 

 

Registration and login form in php Code

connection.php For For mysqli Database Connnection 


<?php
$link=mysqli_connect('localhost','root','','su');
?>




Registration For Validation in php 

s1.php File For Sign Up Page Using HTML PHP & CSS

<?php
include('connection.php');
?>
<!DOCTYPE html>
<html>
<head>
    <title>Sign Up</title>
    <style type="text/css">
        #header{
            width: 100%;
            height: 50px;
            background: orange;

        }
        #container
        {
            width: 100%;
            height: 500px;
        }
        #footer{
         width: 100%;
         height: 50px;
         background-color: orange;
        }
        #ic{
            width: 50%;
            height: 400px;
            background:orange;
            border-radius: 20px;
        }
        td{
            width: 200px;
            height: 50px;
        }
    </style>
</head>
<body>
    <div id="header"><h1 align="center">Engineersworld.in</h1></div>
    <div id="container"><br><br><br>
        <center><div id="ic"><br>
            <h2 align="center">Sign Up</h2>
            <form action="" method="post">
            <table>
                <tr>
                    <td><b>Enter Name</b></td>
                    <td><input type="text" name="name" placeholder="Enter Name" title="Enter Name"></td>
                </tr>
                                <tr>
                    <td><b>Enter E-Mail</b></td>
                    <td><input type="text" name="email" placeholder="Enter E-Mail" title="Enter E-Mail"></td>
                </tr>
                                <tr>
                    <td><b>Enter Password</b></td>
                    <td><input type="password" name="ps" placeholder="Enter Password" title="Enter Password"></td>
                </tr>
                                <tr>
                    <td><b>Re-Enter Password</b></td>
                    <td><input type="Password" name="rps" placeholder="Enter password" title="Enter password"></td>
                </tr>
                                <tr>
                    <td><input type="submit" name="sub" value="Sign Up"></td>
                    <td><input type="reset" name="res" value="Reset" title="Reset"></td>
                </tr>
            </table>
        </form>
        <?php
        if(isset($_POST['sub']))
        {
            $name=$_POST['name'];
            $email=$_POST['email'];
            $ps=$_POST['ps'];
            $rps=$_POST['rps'];
            $l=strlen($ps);
            if(!empty($name) && !empty($email) && !empty($ps))
            {
                    if($ps==$rps)
                    {
                        if($l>5)
                        {
                            if(mysqli_query($link,"insert into s1(name,email,ps) values('$name','$email','$ps')"))
                            {
                                header("Location:login.php");
                            }
                            else
                            {
                                echo "<script>alert('Registration Fill')</script>";
                            }
                        }
                        else
                        {
                            echo "Wrong";
                        }   
                    }
                    else
                    {
                        echo "<script>alert('password Not Metch')</script>";
                    }
            }
            else
            {
                echo "<script>alert('Not Fill')</script>";   
            }
        }
        ?>
            <a href="login.php">Login</a>
        </div></center>
    </div>
    <div id="footer"><h1 align="center">copyright@engineersworld.in</h1></div>
</body>
</html>

Registration Form php Codeing 

 


0 komentar: