<?php
session_start(); //start the session for the page
include("../include/db.php"); //include database file
include("../include/settings.php"); //include configuration file
//Check if page was entered by a submit button
$email=$_POST['email']; //Get username !!FROM FORM!!
$email = ereg_replace(" ", "", $email); //take away all spaces from username (if any) !!FROM FORM!!
$password=base64_encode($_POST['password']); //Get name !!FROMFORM!!
if (empty($email) || empty($password))
{ echo "Empty fields";}
else{
//check to see if the username or email allready excists
$ck=$flash->prepare("SELECT * FROM `user` WHERE `email`=:email AND `password`=:password "); //get rows where the username or email address is allready registered
$ck->bindParam(':email',$email);
$ck->bindParam(':password',$password);
$ck->execute();
//if email address allready excists
if($ck->rowCount() > 0){
echo "user loged in successfully";
}
else{ echo "Login or password inccorect";}
}
?>
use that phpand keep the alert(result);
it should be clear now