Skip to main content

How Create Login Page with Database and Session Module In PHP

*  Create Login Page With Database *

-> First Download Wamp Server or Xamp Server and Setup Your Drive And Check Avaiblity Of Xamp or Wamp.

-> Create Database in mysql database. and Create New Table and Insert New Record Like User name, Password, Full name, And extra Details....

-> and next Step is Create new page login.php or index.php

-> Write Code on Creating File.

->Establish Connection of Your Databse.

->create new file like config or connection... like(dbuser,dbpassword, and connection details..)

->The Following Code write in your index or Login Page.


<?php

    //old path

    //include('config/connection.php');

    //new path

    include('../../db/connection.php');

    if(isset($login))

    {

        $str="select*from admin where status='active' and user_name='$username' and password='$password';";

        $data=mysqli_query($conn,$str);

        $search=mysqli_num_rows($data);

        if($search>0)

        {

            $_SESSION['user_name']=$username;

            ?><script>window.location='<?php echo $domain_path; ?>dashboard.php';</script><?php

        }

        else

        {

           $error="Incorrect Username or Password...";

        }

    }

?>


Comments

Popular posts from this blog

Download PHP Full Source Code Free Template. How to Download Free Responsive Website Templates

  * Important Note To Download Templates * 1. Conceptual Simplicity :  As the information is represented in form of tree structure, it is easy to view, understand, and retrieve the data. This helps the database designer to obtain conceptual clarity of relationship.  2.. Database security :  Security is provided by DBMS. Thus Programming effort is decreased as compared to file system in which programmer has to write the programs for implementing security.  3. Data independence :  If changes are made in design of database, DBMS takes care of cascading it throughout the system. There is no need to make change in system. * Limitation of Download Templates * 1. Complexity :  To implement the database using hierarchical model. programmer needs to have detailed knowledge of how the data is’ stored has to traverse entire tree for the same.  2. Data Redundancy :  To implement many to many ‘relationships amongst data repeatition of data is required. T...

Advantage and Disadvantage Of PHP Limitation of PHP

               *  ADVANTAGE OF PHP HIERARCHICAL DATATABLE MODELS * 1. Conceptual Simplicity :  As the information is represented in form of tree structure, it is easy to view, understand, and retrieve the data. This helps the database designer to obtain conceptual clarity of relationship.  2.. Database security :  Security is provided by DBMS. Thus Programming effort is decreased  compared to file system in which programmer has to write the programs for implementing security.  3. Data independence :  If changes are made in design of database, DBMS takes care of cascading it throughout the system. There is no need to make change in system.  * DISADVANTAGE OF PHP HIERARCHICAL DATABASE MODELS  * 1. Complexity :  To implement the database using hierarchical model. programmer needs to have detailed knowledge of how the data is’ stored has to traverse entire tree for the same.  2. Data Redundan...

What Is PHP ??

  PHP is a best Language of Website Development. There are many country and colleges are accepted php language. php in many library and function are used. That main language of website development php starting simple syntax and example. so start in few days to learn php.   to generate any system and dynamic working are possible throw a php.  there are following keyword of php.