Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <?php
- if(!empty($_GET['tablou'])){
- include('getIP.php');
- $id= $_GET['tablou'];
- $con = new PDO('mysql:host=mysql5.hostbase.net;dbname=artclubl_luminita','','');
- $is = $con->prepare("SELECT status FROM tablouri WHERE id=:id");
- $is->execute(array(':id'=>$id));
- if($is->rowCount()){
- foreach($is as $row){
- if($row['status']=="valabil"){
- $send = $con->prepare('UPDATE tablouri SET clientIP=:ip,status="in_cart" WHERE id=:id');
- $send->execute(array(":ip"=>get_client_ip(),":id"=>$id));
- if($send){
- header("Location:galerie.php");
- }else{
- echo"error";
- }
- }else{
- header('Location: in_cos.html');
- }
- }
- }
- }
- ?>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement