voila j'ai un jeu de grattage qui quand j'y joue et que je gagne 0.01 point cela s'ajoute normalement a ma base de donnée tandis que quand je gagne 0.02 et 0.03 tt se que j'avais ds ma base de donnée s'efface pourquoi? voila mon script
<?php
require ("config.inc.php");
session_start();
if(!session_is_registered(login)) {
echo "<FORM name='ok' ACTION=erreur.php METHOD=POST>";
echo "</FORM>";
echo "<script>";
echo "document.ok.submit();";
echo "</script>";
exit;
}
else {
}
?>
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
<head>
<title>Document sans titre</title>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
<script language="JavaScript" type="text/JavaScript">
<!--
function MM_reloadPage(init) { //reloads the window if Nav4 resized
if (init==true) with (navigator) {if ((appName=="Netscape")&&(parseInt(appVersion)==4)) {
document.MM_pgW=innerWidth; document.MM_pgH=innerHeight; onresize=MM_reloadPage; }}
else if (innerWidth!=document.MM_pgW || innerHeight!=document.MM_pgH) location.reload();
}
MM_reloadPage(true);
//-->
</script>
</head>
<body>
<div id="Layer1" style="position:absolute; left:230px; top:381px; width:435px; height:44px; z-index:1">
<?php
echo "<center>Bienvenu ,cher(e) $login, sur ton espace membre. Tu peux désormais accéder à ton compte, aux cadeaux, aux news, aux bzzzpass ,..... et plein d'autres choses encore.</center>";
?>
<?
// CONNEXION MYSQL
$db_link = @mysql_connect($server,$user,$pass);
if(!$db_link) {echo "Connexion impossible."; exit;}
$sql_bdd = "bzzzland_db";
// SELECTION DE L'ENREGISTREMENT CONTENANT L'ID EN COURS
$requete=mysql_db_query($sql_bdd,"select * from compte where login=\"$login\"",$db_link) or die(mysql_error());
// LIGNE FACULTATIVE : RECUPERATION DU PSEUDO
$tickets1=mysql_result($requete,0,"partie1");
$bonus1="0";
$score=mysql_result($requete,0,"point");
if($tickets1 < "1" && $bonus1 < "1") {
echo "Vous n'avez plus de tickets disponibles pour ce jeu.";
}
else {
$nbtickets = $tickets1 - 1;
$requete=mysql_db_query($sql_bdd,"UPDATE compte SET partie1=\"$nbtickets\" WHERE login=\"$login\"",$db_link) or die(mysql_error());
$totaltickets = $tickets1 + $bonus1;
echo "Il vous reste <b>";
echo $nbtickets;
echo "</b> tickets pour ce jeu.<br><br><br>";
$gain=0;
$ver = Array();
for($nbver=1; $nbver<=3; $nbver++);{
$Cara = "1233333333"; // Caractére possible
$Nbrcara = 1; // Nombre de caractére dans le mod de passe
$nc="";
srand((double)microtime()*1000000);
$nc.= $Cara[rand()%strlen($Cara)];
if ($nc!="3") {
$gain++;
}
$ver[$nbver] = $nc;
}
if ($gain == "1"){
$newscore = $score + 0.01;
}
if ($gain == "2"){
$newscore = $score + 0.02;
}
if ($gain == "3"){
$newscore = $score + 0.03;
}
$requete=mysql_db_query($sql_bdd,"UPDATE compte SET point=\"$newscore\" WHERE login=\"$login\"",$db_link) or die(mysql_error());
echo " ";
echo '<OBJECT classid="clsid:D27CDB6E-AE6D-11cf-96B8-444553540000"
codebase="http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=6,0,0,0"
WIDTH="375" HEIGHT="250" id="pomme" ALIGN="">
<PARAM NAME=movie VALUE="pomme.swf?ver1=';
echo $ver[1].'&ver2='.$ver[2].'&ver3='.$ver[3];
echo '"> <PARAM NAME=quality VALUE=high> <PARAM NAME=bgcolor VALUE=#000000> <EMBED src="pomme.swf" quality=high bgcolor=#000000 WIDTH="300" HEIGHT="160" NAME="12" ALIGN=""
TYPE="application/x-shockwave-flash" PLUGINSPAGE="http://www.macromedia.com/go/getflashplayer"></EMBED>
</OBJECT>';
}
echo "<br><br><br>";
if($tickets1 < "1" && $bonus1 < "1") {
}
else {
echo " [ <a href='pomme.php'>Rejouer</a> ]";
}
echo " [ <a href='index2.php'>Quitter</a> ]";
// DECONNEXION MYSQL
mysql_close($db_link);
?>
</div>
<div id="Layer2" style="position:absolute; left:10px; top:627px; width:125px; height:31px; z-index:2"><a href="deconexion.php"><img src="images/deconnexion2.gif" width="120" height="28" border="0"></a></div>
<div align="center" id="Layer3" style="position:absolute; left:21px; top:217px; width:105px; height:13px; z-index:3">
<? $db = mysql_connect('xxxxx','xxxxxx',xxxxxxx') or die ("erreur de connexion");
mysql_select_db('xxxxxx_db',$db) or die ("erreur de connexion base"); $requete=mysql_query("SELECT * FROM compte WHERE login='$login'"); $point=mysql_result($requete,0,"point");
echo"<em><strong><h3>$login</h3></strong></em>$score points</b>"; ?>
</div>
<div id="Layer4" style="position:absolute; left:310px; top:472px; width:20px; height:24px; z-index:4">
<object classid="clsid:D27CDB6E-AE6D-11cf-96B8-444553540000" codebase="http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=6,0,29,0" width="300" height="300">
<param name="movie" value="grattagemoi2.swf">
<param name="quality" value="high">
<embed src="grattagemoi2.swf" quality="high" pluginspage="http://www.macromedia.com/go/getflashplayer" type="application/x-shockwave-flash" width="300" height="300"></embed></object>
</div>
<p><img src="images/mouche1.gif" width="180" height="180"> <img src="images/titre.gif" width="413" height="175">
<img src="images/mouche2.gif" width="180" height="180"></p>
<p><img src="images/menu1.gif" width="150" height="80"><img src="images/bienvenu.gif" width="180" height="50" hspace="200"><br>
<a href="index2.php"><img src="images/menu2.gif" width="150" height="25" border="0"></a><br>
<a href="compte.php"><img src="images/menu3.gif" width="150" height="33" border="0"></a><br>
<a href="cadeaux.php"><img src="images/menu4.gif" width="150" height="25" border="0"></a><br>
<img src="images/menu5.gif" width="150" height="32"><br>
<a href="news.php"><img src="images/menu6.gif" width="150" height="26" border="0"></a><br>
<a href="parrainage.php"><img src="images/menu7.gif" width="150" height="33" border="0"></a><br>
<a href="bzzzpass.php"><img src="images/menu8.gif" width="150" height="28" border="0"></a><br>
<a href="sheepbook.php"><img src="images/menu9.gif" width="150" height="31" border="0"></a><br>
<a href="partenaire.php"><img src="images/menu10.gif" width="150" height="30" border="0"></a><br>
<a href="contact.php"><img src="images/menu11.gif" width="150" height="29" border="0"></a><br>
<a href="http://68735.aceboard.fr/connexion.php?directv=adminforum.php?"><img src="images/menu12.gif" width="150" height="28" border="0"></a><br>
<img src="images/menu13.gif" width="150" height="40"></p>
</body>
</html>