forked from HumanWorks/phpUserClass
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathexample-jquery.php
50 lines (49 loc) · 2.19 KB
/
example-jquery.php
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
<?php
$successURL = 'index.php';//Where the user can go after a successful login
if ( $_GET['form'] == 1 ){
if(isset($_POST['nameuser'])){
require_once 'access.class.php';
$user = new flexibleAccess();
if ( $user->login( $_POST['nameuser'], $_POST['passuser'], true ))
echo '{'.
'succes: true,'.
'title: \'<strong>Login Success</strong>\', '.
'content: \'You have authenticated successfuly<br />'.
'click <a href="'.$successURL.'">here</a> to continue\''.
'}';
else
echo '{'.
'succes: false,'.
'title: \'<strong>Login Failed : User and Password combination is not valid</strong>\''.
'}';
}else{
echo '<form name="ajaxform" id="ajaxform">
<label>Username</label>
<input type="text" name="nameuser" id="nameuser" class="textfield" value="'.$_POST['nameuser'].'" />
<label>Password</label>
<input type="password" name="passuser" id="passuser" class="textfield" />
<input type="submit" name="submit" id="submit" class="buttonfield" value="Login" />
</form>';
}
exit;
}
?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>ajax PHP Login with jquery</title>
<meta name="robots" content="noindex,nofollow" />
<link href="js/login.css" rel="stylesheet" media="all" type="text/css" />
<script language="javascript" type="text/javascript" src="js/jquery.js"></script>
<script language="javascript" type="text/javascript" src="js/form.js"></script>
<script language="javascript" type="text/javascript" src="js/login.js"></script>
</head>
<body>
<div id="err"></div>
<div id="wrapper"></div>
<div id="footer">
original code by
<a href="http://www.chazzuka.com/" title="web design service by freelance web designer">bali web design</a> </div>
</body>
</html>