Donc voilà ma page d'échange de points:
<?php
session_start();
if(isset($_POST["trade"]))
{
header('Location: '.$_POST["trade"]);
}
?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>Boutique <?php echo $nom_serveur ?></title>
<style type="text/css">
<!--
.Style1 {
color: #000000;
font-size: 14px;
font-weight: bold;
}
.Style2 {
color: #00CCFF;
font-weight: bold;
}
-->
</style>
</head>
<body>
<body onselectstart="return false" oncontextmenu="return false" ondragstart="return false" onMouseOver="window.status='©<?php echo $nom_serveur ?>; return true;" >
<?php
echo '<form method=\"post\" action=\"boutique3.php\">';
$nb_points = $_SESSION['points'];
if($_GET['transfert_points'] == 1)
{
$id_compte = $_SESSION['id_compte'];
$points_debut = $_SESSION['points'];
/*-----------------------------------------------------------*/
{
}
/*-----------------------------------------------------------*/
$points_fin = $points_debut - $nb_points;
$points_fin = ceil($points_fin);
mysql_select_db($logon,$connexion)or die("connexion à la base impossible");
$argent = mysql_query("UPDATE accounts SET points='$points_fin' WHERE acct='".$_SESSION['id_compte']."'");
$points_fin1 = $points_debut1 + $nb_points;
$points_fin1 = ceil($points_fin1);
mysql_select_db($logon,$connexion)or die("connexion à la base impossible");
$verif = mysql_query("SELECT login FROM accounts WHERE login='".$compte_arrive."'") or die ("Le compte n'existe pas!");
$row_verif = mysql_fetch_assoc($verif);
$points_fin1 = $points_debut1 + $nb_points;
$points_fin1 = ceil($points_fin1);
mysql_select_db($logon,$connexion)or die("connexion à la base impossible");
$argent1 = mysql_query("UPDATE accounts SET points='$points_fin1' WHERE login='".$compte_arrive."'");
$ajout = mysql_query($requete);
echo'Le don de points c\'est bien passé!<meta http-equiv="refresh" content="1;URL=boutique2.php">';
}
echo'<div id="contenu"><table align="center" width="100%" border="1" cellspacing="1" cellpadding="2"><tr>
<td align="center" class="texte2"><hr style="color:#FFFFFF" />
<span class="titre"><strong>DONNER DES POINTS A UN AMIS </strong></span><hr style="color:#FFFFFF" />';
echo'<table width="90%" border="1" cellpadding="2" cellspacing="0">';
echo'<tr>';
echo'<td align="center" class="texte2"><strong>Nom du Compte du Destinataire</strong></td>';
echo'<td align="center" class="texte2"><strong>Nombre de points à donner</strong></td>';
echo'</tr>';
echo'<tr>';
echo'<td align="center" class="texte2"><input type="text" size="22" name="compte_arrive" value="'.$compte_arrive.'" /></td>';
echo'<form action="" method="post">';
echo'<td align="center"><select name="points">';
for($i=1;$i<= $nb_points;$i++) {
echo'<option value="<?php echo $i;?>">Echanger '.$i.' point(s)</option>';
}
echo'</select></td>';
echo'</tr>
<tr>
<td height="25" colspan="2" align="center" class="texte2"><strong>ATTENTION:</strong> Tout DON de points à un autre compte est irréversible. </td>
</tr>';
echo'<tr>
<td height="25" colspan="2" align="center"><input type="hidden" name="gm" value="go" />';
if ($nb_points == 0)
{echo'<input type="submit" value="Envoyer" DISABLED/>';};
if ($nb_points >= 1)
{echo'<a href="boutique3.php?id='.$_GET['id'].'
&cat=7&transfert_points=1"><input type="submit" value="Envoyer"/></a></form>';};
echo '</td></table>';
// Fin de la partie de sélection des points
?>
Se qui se passe c'est que cela ne vérifie pas si le compte vers lequel on souhaite envoyer les points existe, il retire tous les points du compte >.< et il ne les ajoute pas au compte de destination...Un petit coup de pouce ne serais pas de refus!