PHP: Remove URL Param?

前端 未结 6 1985
感情败类
感情败类 2021-01-26 19:38

I have a function that I call with ?clear-cart appended to the end of my page; as you can probably guess, this function clears the user\'s cart.

I call it l

6条回答
  •  萌比男神i
    2021-01-26 19:49

    Something along the lines of this should do what you want:

    if (isset($_GET['clear-cart'])) {
    
      clear_cart();
      header('Location: http://test.local/');
    
    }
    

    Modify to suit your needs.

提交回复
热议问题