Jump to content

IE double insert vs Mozilla single insert


damerit

Recommended Posts

I added code to the top of my page to log users and I get a double entry sometimes when I am using IE, but it doesn't do it in FireFox.

 

session_start();

require_once('Connections.php');

 

        $q = "insert into log (logid, userid, timestamp)

        VALUES ('$dtid', '$userid', '$submitDate')";

        mysql_query($q, $DTDB) or die (mysql_error());

 

Problem: Once I moved it to the production it posts twice to the database, but it doesn't post twice all the time. It is random when I use IE 6.0. When I use Mozilla I don't have this problem.

 

Are there any suggestions as to why this would post twice in IE 6.0?

Yes, what I mean is that the insert statement is being initiated twice on some istances in IE. It happens often in IE. When I use FireFox it doesn't happen at all.

 

I have the link change colors when it has been clicked on and a running count of how many times it has been clicked on.

 

I can't seem to figure out why this is browser related. There is no onload or reload event taking place.

 

thx..

This is all I have on the page and it still inserts twice randomly...

 

<?php

session_start();

require_once('Connections.php');

$user = $_SESSION['valid'];

 

if(isset($user)){

  }

  else{

  header('Location: login.php');

}

mysql_select_db($database_DT, $DB);

$nowDate = date('Y-m-d H:i:s');

$submitDate = date('Y-m-d H:i:s');

 

$id = $_GET['id'];

 

$q = "insert into log (logid, userid, timestamp)

VALUES ('$id', '$user', '$submitDate')";

mysql_query($q, $DB) or die (mysql_error());

 

echo $id;

?>

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.