Hi there, I am having problem with my login page, here is my config file:
<?php $dbhost = "localhost"; $dbuser = "root"; $dbpassword = ""; $dbdatabase = "myblog"; $config_blogname = "Something"; $config_author = "someone"; $config_basedir = "http://127.0.0.1/sites/myblog/"; ?>and here is my login.php page:
require (“config.php”);
$db = mysql_connect($dbhost, $dbuser, $dbpassword);
mysql_select_db($dbdatabase, $db);
if(isset($_POST[‘submit’])) {
$sql = “SELECT * FROM logins WHERE username = '” . $_POST[‘username’] .
“’ AND password = '” . $_POST[‘password’] . “’;”;
$result = mysql_query($sql);
$numrows = mysql_num_rows($result);
if($numrows == 1) {
$row = mysql_fetch_assoc($result);
session_register(“USERNAME”);
session_register(“USERID”);
$_SESSION['USERNAME'] = $row['username'];
$_SESSION['USERID'] = $row['id'];
header("Location: " . $config_basedir);
}
else {
header("Location: " . $config_basedir . “/login.php?error=1”);
}
}
else {
require(“header.php”);
if(isset($_GET[‘error’])) {
echo “Incorrect login, please try again!”;
}
?>
anytime I try to login with the user name “root” and blank for password I get this error:
Access forbidden!
You don’t have permission to access the requested object. It is either read-protected or not readable by the server.
If you think this is a server error, please contact the webmaster.
Error 403
localhost
Can anybody help please