<?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);
?>