php reload page without posting data

前端 未结 6 1841
悲&欢浪女
悲&欢浪女 2020-12-11 04:35

I\'m trying to refresh a page without sending POST from the previous time.

I\'ve tried

window.open(\"postme.php?r=t\", \"_self\");

6条回答
  •  长情又很酷
    2020-12-11 05:10

    Redirect the user to the same page after you're finished using their POST data.

    $URI = $_SERVER['REQUEST_URI'];
    
    if(!empty($_POST)){
        //magic
    
        header("location:$URI");
    }
    

    Now when you refresh, it won't have POST data to resubmit.

提交回复
热议问题