lilman Posted November 15, 2006 Share Posted November 15, 2006 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. Quote Link to comment Share on other sites More sharing options...
SharkBait Posted November 15, 2006 Share Posted November 15, 2006 I haven't seen this happen and I code my sites in Firefox, then check them on IE and then whatever other browser I feel like loading up.If ya want, post the code that you think is looping :) Quote Link to comment Share on other sites More sharing options...
lilman Posted November 15, 2006 Author Share Posted November 15, 2006 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";} Quote Link to comment Share on other sites More sharing options...
lilman Posted November 15, 2006 Author Share Posted November 15, 2006 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 Link to comment Share on other sites More sharing options...
SharkBait Posted November 15, 2006 Share Posted November 15, 2006 Can you post the entire code? Do you check for a user_name that is already taken? That would stop the double INSERT at that level.Pehaps there is an odd loop happening..?!? Quote Link to comment Share on other sites More sharing options...
trq Posted November 15, 2006 Share Posted November 15, 2006 [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. Quote Link to comment Share on other sites More sharing options...
lilman Posted November 15, 2006 Author Share Posted November 15, 2006 Well it works fine on IE but not Mozilla, so I assumed it could be because of the broswer. I will try the if statement and see if that does the trick. Quote Link to comment Share on other sites More sharing options...
btherl Posted November 15, 2006 Share Posted November 15, 2006 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. Quote Link to comment Share on other sites More sharing options...
lilman Posted November 15, 2006 Author Share Posted November 15, 2006 [quote]Alternatively you can log requests to a file at the start of the script.[/quote]I am not sure how to do that, could you please tell me how I could go about setting that up? Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.