Problem with my Login Plugin

Question

I am trying to create my test login plugin here with the following code which isn’t giving me any error but doesn’t want to work. I am a beginner can somebody help point me to the right direction here. Thanks

<?php
/**
 * Plugin Name:       LD Login Form 
 * Plugin URI:        https://testsite.co.za
 * Description:       Empire Investment Login Form
 * Version:           1.0
 * Author:            Luthando
 * Author URI:        https://testsite.co.za
 */

function luecustom_form() {
 ?>
<form action="<?php echo $_SERVER['REQUEST_URI']; ?>" method="post" style="color: #fff">
  <div class="form-group">
    <label for="email">Email address:</label>
    <input name="email" type="email" class="form-control" id="email">
  </div>
  <div class="form-group">
    <label for="pwd">Password:</label>
    <input name="pass" type="password" class="form-control" id="pwd">
  </div>
  <div class="form-group form-check">
    <label class="form-check-label">
     <a style="color: #08a873" href="#"> Forgot Password? </a>    </label>
  </div>
  <input style="background: #08a873; margin-top: 5px; width: 100%" type="submit" class="btn btn-primary btn-lg active" role="button" aria-pressed="true" value="Login"/>

  <div class="alert alert-danger" role="alert">
     <?php echo $errMessage; ?>
</div>

</form>
 <?php
}
add_shortcode('luthandoLog', 'luecustom_form');
$errMessage = "";

if(isset($_POST['submit'])) {


 global $wpdb;

 $errMessage = "";
 $email = $_POST['email'];
 $pass = $_POST['pass']; 

 $check = $wpdb->get_col("SELECT email.users , pass.users FROM users WHERE email.users = $email && pass.users = $pass"); 


    if($check->num_rows == 1){

    header("Location: https://dhetcodesigns.000webhostapp.com/?page_id=5");
    exit;

    }else{
        $errMessage = "Incorrect username/password";
    }

}
?>
0
, , Luthando Dlamini 3 years 2019-10-19T00:44:26-05:00 0 Answers 90 views 0

Leave an answer

Browse
Browse