如何设置产品只能为发布者编辑的权限

This is on my listProduct to send the id for edit. When i change the test.com/editProduct.php?id=1 to id=2 which is not under my product but i can edit too.


<script type="text/javascript">
  function editProduct(id){
    window.location="editProduct.php?id="+id;
  }
</script>

Any ideas to solve this problem ?

You will need to write some code on editProduct.php page. check the product is yours or not through product id.

try this,

<script type="text/javascript">
  function editProduct(id){
    var url = "editProduct.php?id="+id;
    location.href = url;
  }
</script>

i hope it will be helpful.