chris8421 Posted January 8, 2010 Share Posted January 8, 2010 Hi, I am pretty new to php. I am trying to set up a section on my website that is password protected. Everything was working fine on my local server, but I am running into a problem testing it with godaddy. When the user types in the wrong username or password, the page notifies them and then the second time the enter in information in the html form, the php variables do not read the POST variables unless I wait 20 seconds before trying again. I've tried a few things and nothing changes the fact that the second time the php script runs, the $user and $password variables are blank, unless I wait 20 seconds. Here is the php script that runs after the html form is filled out. <?php $user = $_POST['username']; $pass = $_POST['password']; include("dbinfo.inc.php"); mysql_connect('$myhostname',$myusername,$mypassword); mysql_select_db($database) or die( "Unable to select database"); $query="SELECT * FROM userinfo WHERE username='$user'"; $result=mysql_query($query); $num=mysql_numrows($result); mysql_close(); if ($num == 0){ echo "$user, $pass"; //Troubleshooting, first time correct output, after the result is " , " include("signininc.html"); //goes to form with error message } else{ $passwordcheck=mysql_result($result,0,"password"); if ($pass != $passwordcheck){ include("signininc.html"); //goes to form with error message } else{ $folder=mysql_result($result,0,"folderid"); include("$folder/$folder.html"); } } ?> Any help is much appreciated, I've been stuck a whole day on this. Chris Link to comment https://forums.phpfreaks.com/topic/187756-post-delay/ Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.