Advertisement
kemkriszt

123

Sep 10th, 2014
306
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
PHP 0.68 KB | None | 0 0
  1. <?php
  2.     if(!empty($_GET['tablou'])){
  3.         include('getIP.php');
  4.         $id= $_GET['tablou'];
  5.         $con = new PDO('mysql:host=mysql5.hostbase.net;dbname=artclubl_luminita','','');
  6.         $is = $con->prepare("SELECT status FROM tablouri WHERE id=:id");
  7.         $is->execute(array(':id'=>$id));
  8.         if($is->rowCount()){
  9.             foreach($is as $row){
  10.                 if($row['status']=="valabil"){
  11.                     $send = $con->prepare('UPDATE tablouri SET clientIP=:ip,status="in_cart" WHERE id=:id');
  12.                     $send->execute(array(":ip"=>get_client_ip(),":id"=>$id));
  13.                     if($send){
  14.                         header("Location:galerie.php");
  15.                     }else{
  16.                         echo"error";
  17.                     }
  18.                 }else{
  19.                     header('Location: in_cos.html');
  20.                 }
  21.             }
  22.         }
  23.     }
  24. ?>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement