Simple Login code in php with session

In PHP there many time we need to restrict the user to access the page only after the login in system. So in PHP in have written much simple way to login. This tutorial will help beginner a lots.

So first we need to create database in PHPMyadmin

After that we need to create index.php file in our folder

Our form will be like:

<form method=”post” enctype=”multipart/form-data”>
    <input type=”text” name=”username” placeholder=”Username”>
    <input type=”password” name=”password” placeholder=”Password”>
    <input type=”submit” name=”login” value=”login”>
  </form>
Make Connection file name ‘config.php
Now include config.php file in index.php
<?php
            include(‘config.php‘);
?>
And script for login process will be like…..
This is our very simple model to login system in php. Hope you like this if you have any query then please leave a comment i will answer.
wait for my new tutorial when i will explain login using Ajax , php , mysql.

Vijay maurya

Vijay maurya is a web developer having several years experience and passionate about programming. Vijay worked in many project along with reputed companies. The main aim of blogging is to spread knowledge who need help in development and also to improve knowledge and skills.

Leave a Reply

Your email address will not be published. Required fields are marked *