-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathoven.php
More file actions
34 lines (24 loc) · 891 Bytes
/
oven.php
File metadata and controls
34 lines (24 loc) · 891 Bytes
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
<?php
/*
(c) 2006 Reed Morse <firstname.lastname at gmail.com>
and Pau Santesmasses <firstname at lastname.net>
*/
require("functions.php");
require("configuration.php");
connect();
$username = $_POST['username'];
$password = $_POST['password'];
$query_confirm = "SELECT * FROM `".$user_table."` WHERE `username`='".$username."'";
$result_confirm = mysql_query($query_confirm);
$numrows = @mysql_num_rows($result_confirm);
$user = @mysql_fetch_array($result_confirm);
$pass_md5 = md5($password);
if(!($numrows == 0) && !($numrows == "") && $pass_md5 == $user['password']){
setcookie('snickerdoodle', 'polarbears', time()+60*60*24*365, '/');
setcookie('usename', $user['id'], time()+60*60*24*365, '/');
header("Location: home.php");
} else {
header("Location: login.php?failed");
// echo '<div id="fail"><p>Authentication failed. Please refresh page.</p></div>';
}
?>