Mozilla Firefox PROBLEM ???
Posted: Mon Jul 04, 2005 3:33 pm
I still don't get why is this hepening. If I'm browsing (testing) on local machine with IE 6 everithing is woorking nice, but if I'm browsing with Mozilla Firefox I get double records inserted into db, and everything that has something to do with database (update or insert) is is doing it double or twice.
here are two tables
FIRST TABLE
zaglavlje_ponuda
broj int(11)
datum varchar(12)
trajanje varchar(12)
kupac int(11)
id int(11) - primary k
SECOND TABLE
stavke_ponude
id int(11) - primary k
broj int(11)
sifra text
opis longtext
kolicina text
cijena text
popust text
vrijednost text
porez text
ukupno text
and this is code
I would aprecheate if someone could help me or just give me a good direction of resolving this problem.
Already 3 days trying to resolve this problem
Please help meything that has something to do with database (update or insert) is is doing it double or twice.
here are two tables
FIRST TABLE
zaglavlje_ponuda
broj int(11)
datum varchar(12)
trajanje varchar(12)
kupac int(11)
id int(11) - primary k
SECOND TABLE
stavke_ponude
id int(11) - primary k
broj int(11)
sifra text
opis longtext
kolicina text
cijena text
popust text
vrijednost text
porez text
ukupno text
and this is code
I would aprecheate if someone could help me or just give me a good direction of resolving this problem.
Already 3 days trying to resolve this problem
Please help me
here are two tables
FIRST TABLE
zaglavlje_ponuda
broj int(11)
datum varchar(12)
trajanje varchar(12)
kupac int(11)
id int(11) - primary k
SECOND TABLE
stavke_ponude
id int(11) - primary k
broj int(11)
sifra text
opis longtext
kolicina text
cijena text
popust text
vrijednost text
porez text
ukupno text
and this is code
Code: Select all
<?
session_start();
$broj_ponude = $_SESSION['broj_ponude'];
?>
<?
echo "Broj ponude: " . $broj_ponude;
$id = $_GET['id'];
include('../stranice/con_db.php');
$result = mysql_query("SELECT * from proizvodi where id = '$id'") or die (mysql_error());
$row = mysql_fetch_array($result);
$sifra = stripslashes($row["sifra"]);
$naziv = stripslashes($row["opis"]);
$cijena1 = $row["cijena"];
$datum = time();
$dana = 8;
$sati = 24;
$minuta = 60;
$sekunda = 60;
$valuta = $dana * $sati * $minuta * $sekunda;
mysql_free_result($result);
if(!isset($broj_ponude))
{
$query_count_broj_ponude = mysql_query("select max(broj) as zadnji_broj_ponude from zaglavlje_ponuda ") or die (mysql_error());
$result_row_broj_ponude = mysql_fetch_assoc($query_count_broj_ponude);
$zadnji_broj = $result_row_broj_ponude['zadnji_broj_ponude'];
$novi_broj_ponude = $zadnji_broj + 1;
$broj_ponude = $_SESSION['broj_ponude'] = $novi_broj_ponude;
$query = "insert into zaglavlje_ponuda
(broj, datum, trajanje) values
('$broj_ponude', '$datum', '$valuta')";
mysql_query($query) or die (mysql_error());
}
$slova=array(",");
$izmjena=".";
$cijena = str_replace($slova, $izmjena, $cijena1);
$porez = $cijena * (18.0328 / 100);
$osnovica = $cijena - $porez;
$kol = 1;
$pop = 0;
if(!empty($broj_ponude))
{
$query = "insert into stavke_ponude
(broj, sifra, opis, kolicina, cijena, popust, vrijednost, porez, ukupno) values
('$broj_ponude', '$sifra', '$naziv', '$kol', '$osnovica', '$pop', '$osnovica', '$porez', '$cijena')";
mysql_query($query) or die (mysql_error());
}
include('../stranice/disconect.php');
?>Already 3 days trying to resolve this problem
Please help meything that has something to do with database (update or insert) is is doing it double or twice.
here are two tables
FIRST TABLE
zaglavlje_ponuda
broj int(11)
datum varchar(12)
trajanje varchar(12)
kupac int(11)
id int(11) - primary k
SECOND TABLE
stavke_ponude
id int(11) - primary k
broj int(11)
sifra text
opis longtext
kolicina text
cijena text
popust text
vrijednost text
porez text
ukupno text
and this is code
Code: Select all
<?
session_start();
$broj_ponude = $_SESSION['broj_ponude'];
?>
<?
echo "Broj ponude: " . $broj_ponude;
$id = $_GET['id'];
include('../stranice/con_db.php');
$result = mysql_query("SELECT * from proizvodi where id = '$id'") or die (mysql_error());
$row = mysql_fetch_array($result);
$sifra = stripslashes($row["sifra"]);
$naziv = stripslashes($row["opis"]);
$cijena1 = $row["cijena"];
$datum = time();
$dana = 8;
$sati = 24;
$minuta = 60;
$sekunda = 60;
$valuta = $dana * $sati * $minuta * $sekunda;
mysql_free_result($result);
if(!isset($broj_ponude))
{
$query_count_broj_ponude = mysql_query("select max(broj) as zadnji_broj_ponude from zaglavlje_ponuda ") or die (mysql_error());
$result_row_broj_ponude = mysql_fetch_assoc($query_count_broj_ponude);
$zadnji_broj = $result_row_broj_ponude['zadnji_broj_ponude'];
$novi_broj_ponude = $zadnji_broj + 1;
$broj_ponude = $_SESSION['broj_ponude'] = $novi_broj_ponude;
$query = "insert into zaglavlje_ponuda
(broj, datum,
<?
session_start();
$broj_ponude = $_SESSION['broj_ponude'];
?>
<?
echo "Broj ponude: " . $broj_ponude;
$id = $_GET['id'];
include('../stranice/con_db.php');
$result = mysql_query("SELECT * from proizvodi where id = '$id'") or die (mysql_error());
$row = mysql_fetch_array($result);
$sifra = stripslashes($row["sifra"]);
$naziv = stripslashes($row["opis"]);
$cijena1 = $row["cijena"];
$datum = time();
$dana = 8;
$sati = 24;
$minuta = 60;
$sekunda = 60;
$valuta = $dana * $sati * $minuta * $sekunda;
mysql_free_result($result);
if(!isset($broj_ponude))
{
$query_count_broj_ponude = mysql_query("select max(broj) as zadnji_broj_ponude from zaglavlje_ponuda ") or die (mysql_error());
$result_row_broj_ponude = mysql_fetch_assoc($query_count_broj_ponude);
$zadnji_broj = $result_row_broj_ponude['zadnji_broj_ponude'];
$novi_broj_ponude = $zadnji_broj + 1;
$broj_ponude = $_SESSION['broj_ponude'] = $novi_broj_ponude;
$query = "insert into zaglavlje_ponuda
(broj, datum, trajanje) values
('$broj_ponude', '$datum', '$valuta')";
mysql_query($query) or die (mysql_error());
}
$slova=array(",");
$izmjena=".";
$cijena = str_replace($slova, $izmjena, $cijena1);
$porez = $cijena * (18.0328 / 100);
$osnovica = $cijena - $porez;
$kol = 1;
$pop = 0;
if(!empty($broj_ponude))
{
$query = "insert into stavke_ponude
(broj, sifra, opis, kolicina, cijena, popust, vrijednost, porez, ukupno) values
('$broj_ponude', '$sifra', '$naziv', '$kol', '$osnovica', '$pop', '$osnovica', '$porez', '$cijena')";
mysql_query($query) or die (mysql_error());
}
include('../stranice/disconect.php');
?>Already 3 days trying to resolve this problem
Please help me