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.
Link to comment
Share on other sites

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";
}
Link to comment
Share on other sites

[quote]It's strange, it only loops in Mozilla but not IE.  I have tested this out on two computers, it's really puzzling to me.[/quote]

PHP runs on the server, well before it EVER gets to any browser. PHP doesn't even know what a browser is.
Link to comment
Share on other sites

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.
Link to comment
Share on other sites

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • 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.