Advertisement
Guest User

Problème PHP

a guest
Jul 17th, 2015
355
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
PHP 1.82 KB | None | 0 0
  1.         $achat = Securise($_GET['achat']);
  2.         if($achat == "fanperso")
  3.         {
  4.             if($user['point'] >= 0)
  5.             {
  6.                 $sql =
  7.                 $stock2 = mysql_query("SELECT * FROM stock WHERE utilise = '0' LIMIT 1");
  8.                 $stock = mysql_fetch_array($stock2);
  9.                 $row = mysql_fetch_assoc($test);
  10.                 $test = mysql_query("SELECT * FROM service_fansite WHERE username=".$user['username']." LIMIT 1");
  11.                 mysql_query("INSERT INTO transaction (username,quoi,quand) VALUES ('".$user['username']."','commande service FanSite Grauit ','".FullDate('full')."')");
  12.                 mysql_query("INSERT INTO service_fansite (username,service,valable,fin,domaine,acces_utilisateur,acces_mdp,hote,statut) VALUES ('".$user['username']."','FanSite Gratuit','1 mois','".FullDate('default')."','En cours','Pro seulement','Pro seulement','Pro seulement','1')") or die (mysql_error());
  13.                 mysql_query("DELETE FROM stock WHERE id = '".$stock['id']."' LIMIT 1");
  14.                         header('Location: sitefan?achat=ok');
  15.             }
  16.                 else
  17.             {
  18.                 if(mysql_num_rows($test) > 0) {
  19.                 header('Location: sitefan?achat=non');
  20.             }
  21.         }
  22.         }
  23.        
  24.                         if(isset($_GET['achat']))
  25.     {
  26.         $achat = Securise($_GET['achat']);
  27.         if($achat == "ok") { $message = '
  28.                         <div class="alert alert-dismissible alert-success">
  29.                  <button type="button" class="close" data-dismiss="alert">×</button>
  30.                 <strong><center>Bravo! votre service viens d\'être commandé.</center></strong>
  31.                 </div>
  32.         '; }
  33.         elseif ($achat == "non") { $message = '
  34.                         <div class="alert alert-dismissible alert-danger">
  35.                  <button type="button" class="close" data-dismiss="alert">×</button>
  36.                 <strong><center>Vous n\'avez pas assez de points. <a href="recharge">clic ici</a> pour en acheter</center></strong>
  37.                 </div>
  38.         '; }
  39.         elseif(empty($achat)) { header('Location:./sitefan'); }
  40.     }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement