Advertisement
Guest User

Untitled

a guest
Apr 18th, 2014
33
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.73 KB | None | 0 0
  1. $.ajax({
  2. type: "GET",
  3. url: "action.php",
  4. data: { status: "<?php echo $_GET['pid'];?>" }
  5. })
  6.  
  7. <?php
  8. include('db.php');
  9. if(isset($_GET['status']))
  10. {
  11. $status1=$_GET['status'];
  12. $select=mysql_query("select * from product where product_id='$status1'");
  13. while($row=mysql_fetch_object($select))
  14. {
  15. $status_var=$row->status;
  16. if($status_var=='0')
  17. {
  18. $status_state=1;
  19. }
  20. else
  21. {
  22. $status_state=0;
  23. }
  24. $update=mysql_query("update product set status='$status_state' where product_id='$status1' ");
  25. if($update)
  26. {
  27. header("Location: pagination.php");
  28. }
  29. else
  30. {
  31. echo mysql_error();
  32. }
  33. }
  34. ?>
  35. <?php
  36. }
  37. ?>
  38.  
  39. header("Location: pagination.php");
  40.  
  41. header("Location: pagination.php".($_GET['page'] ? '?page='.$_GET['page']:''));
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement