Skip to content
View in the app

A better way to browse. Learn more.

Web Designer Forum

A full-screen app on your home screen with push notifications, badges and more.

To install this app on iOS and iPadOS
  1. Tap the Share icon in Safari
  2. Scroll the menu and tap Add to Home Screen.
  3. Tap Add in the top-right corner.
To install this app on Android
  1. Tap the 3-dot menu (⋮) in the top-right corner of the browser.
  2. Tap Add to Home screen or Install app.
  3. Confirm by tapping Install.

How to confirm popup login detail from database

Featured Replies

Hello Friends,

I have a project where am making the login form a popup box of javascript. My javascript will alert if email or password is missing but i need to check my database to be sure the email and password are correct beforre redirecting the member to member Page.

I am not so good in javascript but better in PHP below are my scripts

$(document).ready(function() {
 $("#login #cancel").click(function() {
 $(this).parent().parent().hide();
 });
 $("#onclick").click(function() {
 $("#logindiv").css("display", "block");
 });
 $("#contact #cancel").click(function() {
 $(this).parent().parent().hide();
 });

 // Login form popup login-button click event.
 $("#loginbtn").click(function() {
 var login_email = $("#login_email").val();
 var login_pword = $("#login_pword").val();
 if (login_email == "" || login_pword == ""){
 alert("Email or Password was Wrong");
 }else{

         $.ajax({
             type:'POST',
             url:'login_pop.php',           
         });
 }
 });
 });
  

below is 'login_pop.php'

<?php
ob_start();
session_start();
include("joined/attach_source.php");


$login_email = stripslashes($_POST[login_email]);
$login_pword =  stripslashes($_POST[login_pword]);
         
$pw = hash('sha512', $pword);                                   //hashing the password  

//check if the email already exist
else{
         
         $check = mysqli_query($syntaxit, "SELECT * FROM members WHERE member='$email' && pword='$pw' ");
         
         if(mysqli_num_rows($check) < 1) {header("location:login.php?issue=This+Email+or+Password+does+not+exist");}
         
         else{
                                 
                                 $result = mysqli_fetch_array($check);{
                                         $confirm = $result[confirmation];
                                         $status = $result[status];
                                         $act_key = $result[activation_code];
                                 }
                                 
                                 if($confirm!='1') {header("location:login.php?issue=You+have+not+confirmed+your+registration");}
                                         
                                 elseif($status!='Active') {header("location:login.php?issue=Your+Account+has+been+deactivated.+Contact+Us+for+detail");}
                                 
                                         
                                 else{
                                                 //UPDATE LAST VISIT TABLE
                                                 $get = mysqli_query($syntaxit, "SELECT cur_date, cur_time FROM logins WHERE member='$email'");
                                                 $row = mysqli_fetch_array($get);{
                                                         $date = $row[cur_date];
                                                         $time = $row[cur_time];
                                                 }
                                                         
                                                 $update = mysqli_query($syntaxit, "UPDATE logins SET cur_date='$cur_date', cur_time='$cur_time', last_date='$date', last_time='$time' WHERE member='$email'");
                                                 
                                                 $_SESSION[memkey] = $act_key;
                                                 header("location:cpanel/home.php");
                                         }
                 }
         }
?>

the problem is that, once the email and password are entered, the popup window will just disappear with checking or redirect them to the member's page.

pls help.

Create an account or sign in to comment

Account

Navigation

Search

Search

Configure browser push notifications

Chrome (Android)
  1. Tap the lock icon next to the address bar.
  2. Tap Permissions → Notifications.
  3. Adjust your preference.
Chrome (Desktop)
  1. Click the padlock icon in the address bar.
  2. Select Site settings.
  3. Find Notifications and adjust your preference.