Jump to content

Firefox running a query twice?


br3nn4n

Recommended Posts

So this one really has me stumped. Why is my query being run twice when I click submit?

 

It shows the page, blinks, then shows the page again.

 

code that processes it:

 

if (isset($_GET['new']) && $_GET['new']=='add') {
require ('../...................inc.php');

mysql_connect($host,$user,$pass);
mysql_select_db('..................');

@$_GET['question'] = $question;
@$_GET['c1'] = $c1;
@$_GET['c2'] = $c2;
@$_GET['c3'] = $c3;
@$_GET['c4'] = $c4;

if ($question == "" || $c1 == "" || $c2 == "" || $c3 == "" || $c4 == "") {
echo "Missing something...try again.";
mysql_close();
exit;
}

mysql_query("INSERT INTO ......... (`......`,`.......`,`...........`,`.............`,`.............`,`..............`) VALUES ('','$question','$c1','$c2','$c3','$c4')") or die(mysql_error());

echo "Your poll was added. It will now show up on the site, as the latest poll. <a href='index.php?do=poll'>Return to polls</a>";
mysql_close();
exit;

 

Did I blank enough private stuff out? ;)

 

Thanks for any ideas..

Link to comment
https://forums.phpfreaks.com/topic/134207-firefox-running-a-query-twice/
Share on other sites

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.