AlabamaHit Posted May 21, 2008 Share Posted May 21, 2008 OK....Let me try to explain this.... To start I have used it in Firefox 2 and Firefox 3.....On Windows and On Linux...... (was hoping it was a bug in firefox 3 to start or a bug in linux firefox but nope) What my problem is i made a forum. Now when you post a topic with Internet Explorer. It works right...... When you do the Exact same thing with fire fox.....no matter the version or OS....It post your topic and post a blank topic...So its like it is double posting but the double post is blank...which regardless the double post is bad, lol.. My querys I'm running is this... $newforumtopic = str_replace($codes, $images, $_POST['fp_text']); $newforumpost=str_replace(array("\n"),array(" "),strip_tags($_POST['fp_text'])); $subject=str_replace(array("\n"),array(" "),strip_tags($_POST['fp_subject'])); $db->query("INSERT INTO forum_topics VALUES('', {$_GET['forum']}, '{$_POST['ft_name']}', '{$_POST['ft_desc']}', 0, $userid, '$u', unix_timestamp(), 0, '', 0, 0, 0)"); $i=$db->insert_id(); $db->query("INSERT INTO forum_posts VALUES('', {$i}, {$r['ff_id']}, $userid, '$u', unix_timestamp(), '{$_POST['ft_desc']}', '$newforumtopic', 0, '', 0, 0) ") or die(mysql_error()); $db->query("UPDATE forum_topics SET ft_last_id=$userid, ft_last_name='$u', ft_last_time=unix_timestamp(), ft_posts=ft_posts+1 WHERE ft_id={$i}"); $db->query("UPDATE forum_forums SET ff_lp_time=unix_timestamp(), ff_posts=ff_posts+1, ff_topics=ff_topics+1, ff_lp_poster_id=$userid, ff_lp_poster_name='$u', ff_lp_t_id={$i}, ff_lp_t_name='{$_POST['ft_name']}' WHERE ff_id={$r['ff_id']}"); $db->query("UPDATE users SET posts=posts+1 WHERE userid=$userid"); $db->query("UPDATE users SET fcredits=fcredits+5 WHERE userid=$userid"); print "[b]Topic Posted![/b]<hr /> "; $_GET['viewtopic']=$i; viewtopic(); } That is the querys for posting a topic. I have never ran into this problem before.....is there something wrong with the querys??? Please help....You help is very very very appreciated. Quote Link to comment Share on other sites More sharing options...
Spudinski Posted May 21, 2008 Share Posted May 21, 2008 Re: Here is a hard one for you Don't use Firefox, it sucks... On a more serious note, I've noticed that on your POST variables, you use ft_ as a prefix. I also see that your variable newforumpost holds the value of the POST variable, but uses a prefix fp_, might be this? But as IE works with it, and Ff doesn't it's most properly Ff, search their mountain of bugs, I think this is a bug in Ff. Quote Link to comment Share on other sites More sharing options...
Tezza` Posted May 21, 2008 Share Posted May 21, 2008 Re: Here is a hard one for you =0, firefox does not suck ;p, its the best browser out there. :) Quote Link to comment Share on other sites More sharing options...
AlabamaHit Posted May 21, 2008 Author Share Posted May 21, 2008 Re: Here is a hard one for you Lol, I don't have much choice on Fire fox for my main box is Linux... but here is the break down of the table above that it might help understand the values... <form action='newforums.php?act=newtopic&forum={$_GET['forum']}' method='post'> <table width='80%' border='1'> <tr> <td align=right>Topic Name:</td> <td align=left><input type='text' name='ft_name' value='' /></td> </tr> <tr> <td align=right>Topic Description:</td> <td align=left><input type='text' name='ft_desc' value='' /></td> </tr> <tr> <td align=right>Topic Text:</td> <td align=left><textarea rows='8' cols='45' name='fp_text'></textarea></td> </tr> <tr> <th colspan=2><input type='submit' value='Post Topic' /></th> </tr> </table></form> Posting that i just noticed i didn't clode the form....i forgot a </form> I will try this real quick... EDIT: Nope not it...i place it in the code now also...still does the same thing. Also here is a picture of what its doing..... See how it has 2 post that was from me posting one time......I posted teh testing topic and it gave me both...Now in IE i is not doing that. It works right..........that is what has me so confussed. Quote Link to comment Share on other sites More sharing options...
Spudinski Posted May 21, 2008 Share Posted May 21, 2008 Re: Here is a hard one for you Validate for empty fields, especially the subject. That should fix it. Quote Link to comment Share on other sites More sharing options...
AlabamaHit Posted May 21, 2008 Author Share Posted May 21, 2008 Re: Here is a hard one for you I might have misunderstood but the subject its validated. THe one you see blank...thats the problem. The one that is filled it right is what i typed in.....But like i said i might have misunderstood... Quote Link to comment Share on other sites More sharing options...
Spudinski Posted May 21, 2008 Share Posted May 21, 2008 Re: Here is a hard one for you You should then use timestamps if validation doesn't work. Here is an example: if ($last_time > (time()-120)) { echo 'Please wait two minutes before you post again.'; exit; } That is also a solution, but depending on what is posted first with firefox, the message would be displayed rather than the post. Quote Link to comment Share on other sites More sharing options...
AlabamaHit Posted May 21, 2008 Author Share Posted May 21, 2008 Re: Here is a hard one for you Its on one post.... say i start a topic called Test and i put in ther blah blah I hit Post and it does it twice....its not the person posting to fast or refreshing or back button.... Quote Link to comment Share on other sites More sharing options...
AlabamaHit Posted May 21, 2008 Author Share Posted May 21, 2008 Re: Here is a hard one for you Sorry for the double post but want to make sure people see it.. Ok I have an idea....Can someoen show me how to make a queyr for this to run ONLY ONCE like a LIMIT of some type this might do it what do you think? $db->query("INSERT INTO forum_posts VALUES('', {$i}, {$r['ff_id']}, $userid, '$u', unix_timestamp(), '{$_POST['ft_desc']}', '$newforumtopic', 0, '', 0, 0) ") or die(mysql_error()); You know and add at the end LIMIT 1 i have tried but got nothing but erros.... or maybe change to a sprinf? have not tried that but dont think it matters though... Got it fixed.....dont know how it worked but it did.... i changed print "[b]Topic Posted![/b]<hr /> "; $_GET['viewtopic']=$i; viewtopic(); To: $_GET['viewtopic']=$i; print "[b]Topic Posted![/b] [url='newforums.php?viewtopic=$i']> Back[/url]"; I decided to try this cause i was thinking maybe firefox was looping the code 2 times...so i figured if i changed that part it would work...So if you ever have this problem there ya go :mrgreen: So with that said...the problem was this viewtopic(); Quote Link to comment Share on other sites More sharing options...
oxidati0n Posted August 13, 2008 Share Posted August 13, 2008 Re: Here is a hard one for you Why do you use so many queries, that's ridiculously bad. Quote Link to comment Share on other sites More sharing options...
iMpuLSe Posted December 12, 2008 Share Posted December 12, 2008 Re: Here is a hard one for you why does firefox do everything in double and how do I stop it from doing everything in sets? Quote Link to comment Share on other sites More sharing options...
blue Posted December 12, 2008 Share Posted December 12, 2008 Re: Here is a hard one for you Try Google Chrome :) Its rather nice. Since FF 3 was released it has constantly crashed. So i have started using Google Chrome I give it a 9.9 out of 10, Where now i give FF a 6 out of 10. FF Dev Team should get their crap straight before posting retarded updates lol.. Quote Link to comment Share on other sites More sharing options...
Floydian Posted December 13, 2008 Share Posted December 13, 2008 Re: Here is a hard one for you It's not a firefox problem. You likely have an img tag with an empty src. Perhaps you didn't have the image ready at the time and put in a [/img] so that you could put in the src later. That will cause the dual load. Quote Link to comment Share on other sites More sharing options...
Guest Anonymous Posted December 13, 2008 Share Posted December 13, 2008 Re: Here is a hard one for you Look at the server logs -- they will show if a "dual load" is the cause of the problem (bad terminology, but it suffices). If you can't see the logs, dump $_SERVER out at the top of the page to a temporary (protected) file - look at the unique ID, it will tell you if you have a "dual load". Quote Link to comment Share on other sites More sharing options...
Floydian Posted December 13, 2008 Share Posted December 13, 2008 Re: Here is a hard one for you I like to run a session counter echo the counter and increment it one if you see it going up by two on each page, you know you have a dual load ;) 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.