I've got a problem with my site:
http://add1.havenfive.com/
For some reason if you hammer it with refreshes fairly quickly.. (just open like 20 tabs all at once within firefox), you'll get a 403 forbidden error.
It locks out the person for around 15 seconds or something like that.
I'm not too sure what could be causing it.. here's my code:
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html>
<head>
<link rel="stylesheet" type="text/css" media="screen" title="User Defined Style" href="css/add1.css">
<title>Add 1 to the Counter!</title>
</head>
<body>
<div class="title">Add<span class="title2">1</span>ToTheCounter!</div>
<div align="center">
<?php
$username="myusername";
$password="mypass";
$database="databasename";
mysql_connect(localhost,$username,$password);
@mysql_select_db($database) or die( "Unable to select database");
$query = "UPDATE count SET count=(count + 1) WHERE count_id=1";
mysql_query($query);
$query = "SELECT * FROM count WHERE count_id=1";
$result = mysql_query($query);
while($add1=mysql_fetch_array($result))
{
echo "<div class='count'>$add1[count]</div>";
}
?>
<div class="main">Why not <a href="http://add1.havenfive.com/">add 1</a>?</div>
<div class="bottom">©2004 <a href="mailto:petepap@nospam_gmail.com?body=Please remove the nospam_ in the email">ADM</a></div>
<div class="notice">If you get a 403 error, just keep refreshing</div>
</div>
</body>
</html>
I even had the same problem if I used a pconnect.. I included this code after one attempt:
<?
$host = "localhost";
$user = "xxxx";
$pass = "xxx";
$db = "xxxx";
$connect = mysql_pconnect($host, $user, $pass);
if ( !$connect )
{
echo "Error connecting to database.\n";
}
mysql_select_db($db) or die( "Unable to select database");
?>
and it had the same problem.
Does it have something to do with my code?
Any help would be appreciated. 🙂
http://add1.havenfive.com/info.php
PHP Info printout if it helps.