Jump to content

Mozilla - Running Query Twice, IE Running Query Once


lilman

Recommended Posts

Kind of relieved but still puzzled.  I spent a couple hours poking around my code tryign to figure out why it would run a query twice. The first time it would insert the information, and then the following time, it would enter all blanks.  I thought it was my code, but no, it appears that it only runs twice in Mozilla but if executed through IE it runs as it should.

Has anyone every dealt with this type of issue? I am really puzzled as to why this is.
function register($group, $user_name, $password, $first_name, $last_name, $gender, $email_address)
{
$password = sha1($password);
//SQL Query
$query = "INSERT INTO users (class, user_name, password, first_name, last_name, gender, email_address) VALUES ('$group', '$user_name', '$password', '$first_name', '$last_name', '$gender', '$email_address')";
$result = mysql_query($query) or die("Error ". mysql_error. " with query ". $query);
if($result)
echo "successful in registering you an account";
else
echo "failed in registering account";
}
Do you have any extensions installed in Mozilla?  Something may be sending a second request to your script.

Check your server logs to see if there is a second request being made.  Alternatively you can log requests to a file at the start of the script.

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.