Jump to content
MakeWebGames

Here is a hard one for you


Recommended Posts

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.

Link to comment
Share on other sites

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.

Link to comment
Share on other sites

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

screenshot.png

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.

Link to comment
Share on other sites

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.

Link to comment
Share on other sites

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

  • 2 months later...
  • 3 months later...

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

Link to comment
Share on other sites

Guest Anonymous

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".

Link to comment
Share on other sites

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.   Paste as plain text instead

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