Advertisement
Guest User

Untitled

a guest
Jul 24th, 2016
76
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.54 KB | None | 0 0
  1. if(isset($_GET['add_cart'])){
  2.  
  3. global $db;
  4.  
  5. $ip = getIp();
  6.  
  7. $pro_id = $_GET['add_cart'];
  8.  
  9. $check_pro = "select * from card where user_ip='$ip' AND prod_id='$pro_id'";
  10.  
  11. $run_check = mysqli_query($db,$check_pro);
  12. if(mysqli_num_rows($run_check) > 0){
  13.  
  14.  
  15. echo ""; //refresh or do nothing
  16. }
  17.  
  18. else {$insert_pro="insert into card (prod_id,user_ip) values ('$pro_id','$ip')";
  19.  
  20. $run_pro= mysqli_query($db,$insert_pro);
  21.  
  22. echo"<script> window.open('woodland.php','_self')</script>";
  23. }
  24. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement