Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- $.ajax({
- type: "GET",
- url: "action.php",
- data: { status: "<?php echo $_GET['pid'];?>" }
- })
- <?php
- include('db.php');
- if(isset($_GET['status']))
- {
- $status1=$_GET['status'];
- $select=mysql_query("select * from product where product_id='$status1'");
- while($row=mysql_fetch_object($select))
- {
- $status_var=$row->status;
- if($status_var=='0')
- {
- $status_state=1;
- }
- else
- {
- $status_state=0;
- }
- $update=mysql_query("update product set status='$status_state' where product_id='$status1' ");
- if($update)
- {
- header("Location: pagination.php");
- }
- else
- {
- echo mysql_error();
- }
- }
- ?>
- <?php
- }
- ?>
- header("Location: pagination.php");
- header("Location: pagination.php".($_GET['page'] ? '?page='.$_GET['page']:''));
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement