-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathpass_exec.php
51 lines (38 loc) · 1.42 KB
/
pass_exec.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
51
<?php
//Include database connection details
require_once('include/config.php');
function clean($str) {
$str = @trim($str);
if(get_magic_quotes_gpc()) {
$str = stripslashes($str);
}
return mysql_real_escape_string($str);
}
$username = clean($_POST['username']);
$qry="SELECT * FROM user WHERE user_name='$username'";
$result=mysql_query($qry);
//Check whether the query was successful or not
if($result) {
if(mysql_num_rows($result) > 0) {
//Login Successful
session_regenerate_id();
$member = mysql_fetch_assoc($result);
$_SESSION['SESS_MEMBER_ID'] = $member['id'];
$_SESSION['SESS_FIRST_NAME'] = $member['user_name'];
$_SESSION['SESS_LAST_NAME'] = $member['password'];
//echo "Username: " . $member['user_name'] . "<br/> Password: " . $member['password'];
//echo '<script type="text/javascript"> alert(\'Hi\'); </script>
$output="Username: " . $member['user_name'] . " | Password: " . $member['password'];
echo '<script type="text/javascript">alert("'.$output.'")</script>';
session_write_close();
//header("location: login.php");
header('Refresh: 0; login.php');
}
else
{
//echo "you are not registered";
echo '<script type="text/javascript"> alert(\'You are not registered. Please Complete Registration first\'); </script>';
header('Refresh: 0; apply.php');
}
}
?>