Join the social network of Tech Nerds, increase skill rank, get work, manage projects...
 
  • How to make a quick login page in Wordpress

    • 0
    • 0
    • 0
    • 0
    • 0
    • 0
    • 2
    • 0
    • 355
    Comment on it

    Hello Reader's! If you are new to Wordpress and want to make a login custom page, then you can see an example below:-


    First you have to create a page on the root, name it login.php

    <?php
    /*
    * Template Name: Sign In 
    */
    
    if($_POST['submit'] == 'signin'){
    $username = $_POST["username"]; 
    $password = $_POST["password"]; 
     $mysqli=mysqli_connect('localhost','root','admin','wordpress') or die("Database Error");
    $sql="SELECT name FROM user WHERE email =  '".$username."' and password = '".$password."' ORDER BY name";
     $result = mysqli_query($mysqli,$sql) or die(mysqli_error());
    
     if($result)
     {
      while($row=mysqli_fetch_array($result))
      {
       echo $row['name']."\n";
      }
     }
    }
    
    get_header(); ?>
    <section>
         <form method = 'post' action ="#">
    <input type="text" name="username"> 
    <input type="password" name="password"> 
    <input type="submit" name="submit"  value="signin">
          </form>          
    </section>    
    <?php
    get_footer(); ?>
    

    Now publish this page by using the template type = signin


    Now as you can see the this page self having the login form and sending the two param username and password to itself. Now we can use mysqli_query function to get the result on this page only and you can code according to you. alt text alt text

    How to make a quick login page in Wordpress

 0 Comment(s)

Sign In
                           OR                           
                           OR                           
Register

Sign up using

                           OR                           
Forgot Password
Fill out the form below and instructions to reset your password will be emailed to you:
Reset Password
Fill out the form below and reset your password: