title: Error 403 localhost Apache/2.4.3 (Win32) OpenSSL/1.0.1c PHP/5.4.7
body: <p>Please help!
  I'm getting following error when I try to log in:</p>
  
  <p><strong>Access forbidden!</strong></p>
  
  <p>You don't have permission to access the requested object. It is either read-protected or not readable by the server.</p>
  
  <p>If you think this is a server error, please contact the webmaster.</p>
  
  <p><strong>Error 403</strong></p>
  
  <p>localhost
  <em>Apache/2.4.3 (Win32) OpenSSL/1.0.1c PHP/5.4.7</em></p>
  
  <p>Code of my login.php is following:</p>
  
  <pre><code>&lt;?php
  session_start();
  require("config.php");
  require("functions.php");
  $db = mysql_connect($localhost, $dbuser, $dbpassword);
  mysql_select_db($dbdatabase, $db);
  if(isset($_POST['submit'])) {
  
  $sql = "SELECT * FROM users 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);
  if($row['active'] == 1) {
  session_register("USERNAME");
  session_register("USERID");
  $_SESSION['USERNAME'] = $row['username'];
  $_SESSION['USERID'] = $row['id'];
  switch($_GET['ref']) {
  case "addbid":
  header("Location: " . $config_basedir
  . "/itemdetails.php?id=" . $_GET['id'] . "#bidbox");
  break;
  case "newitem":
  header("Location: " . $config_basedir . "/newitem.php");
  break;
  case "images":
  header("Location: " . $config_basedir
  . "/addimages.php?id=" . $_GET['id']);
  break;
  default:
  header("Location: " . $config_basedir);
  break;
  }
  }
  else {
  require("header.php");
  echo "This account is not verified yet. You were
  emailed a link to verify the account. Please click on the
  link in the email to continue.";
  }
  }
  else {
  header("Location: " . $config_basedir . "/login.php?error=1");
  }
  }
  else {
  require("header.php");
  echo "&lt;h1&gt;Login&lt;/h1&gt;";
  
  if(isset($_GET['error'])) {
  echo "Incorrect login, please try again!";
  }
  ?&gt;
  &lt;form action="&lt;?php echo
  pf_script_with_get($SCRIPT_NAME); ?&gt;" method="post"&gt;
  &lt;table&gt;
  &lt;tr&gt;
  &lt;td&gt;Username&lt;/td&gt;
  &lt;td&gt;&lt;input type="text" name="username"&gt;&lt;/td&gt;
  &lt;/tr&gt;
  &lt;tr&gt;
  &lt;td&gt;Password&lt;/td&gt;
  &lt;td&gt;&lt;input type="password" name="password"&gt;&lt;/td&gt;
  &lt;/tr&gt;
  &lt;tr&gt;
  &lt;td&gt;&lt;/td&gt;
  &lt;td&gt;&lt;input type="submit" name="submit" value="Login!"&gt;&lt;/td&gt;
  &lt;/tr&gt;
  &lt;/table&gt;
  &lt;/form&gt;
  Don't have an account? Go and &lt;a href="register.php"&gt;Register&lt;/a&gt;!
  &lt;?php
  }
  require("footer.php");
  ?&gt;
  </code></pre>
  
  <p>After following some suggestions on this site on other questions, I changed the code in  httpd.conf which is following:</p>
  
  <pre><code>&lt;Directory /&gt;
      AllowOverride All
       Require all denied
  &lt;/Directory&gt;
  </code></pre>
  
  <p>and also:</p>
  
  <pre><code>&lt;Directory "C:/xampp/cgi-bin"&gt;
      Allow from all
      AllowOverride None
      Options None
      Require all granted
  &lt;/Directory&gt;
  </code></pre>
  
  <p>users table in database:</p>
  
  <p>id int (11) AUTO_INCREMENT Primary
  username varchar(10) latin1_swedish-ci
  password varchar(10) latin1_swedish-ci
  email varchar(100) latin1_swedish-ci
  verifystring varchar(20) latin1_swedish-ci
  active tinyint(4)</p>