Report abuse

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
<?php

// Prevent the file from being cached.
	    	 
	    header("Expires: Mon, 01 Jan 2007 00:00:00 GMT");
	    header("Cache-Control: no-store, no-cache, must-revalidate");
	    header("Cache-Control: post-check=0, pre-check=0", false);
	    header("Pragma: no-cache");
	    header("Pragma: public");
	 
	    
	    // Set the content type of the file.
	 
	    header("Content-Type: plain/text");


$title = $_REQUEST['Username'];
$comments = $_REQUEST['Password'];

 $connect = mysql_connect("127.0.0.1", "dailywisdom", "*****");
        mysql_select_db( "dailywisdom" ,$connect );

$result = mysql_query( "SELECT * FROM  users");

$access = "denied";


while ( $row = mysql_fetch_object( $result ) ){
 if ( ($row->Username == $title) && ($row->Password == $comments) ){
	setcookie ("logincookie", $title); 
 	$access = "granted";
 }
}


if($access == "granted") echo "writing=Access granted";
else echo "writing=Access denied";
mysql_close($connect);
?>