如何从URL PHP删除GET变量?

时间:2018-09-22 15:24:05

标签: php html

在调用GET后如何从URL中删除GET变量?

致电

uploads.gdata.youtube.com’s server IP address could not be found.

被调用后

<a href="?reward">

据我所知,在我的网址中,我看到if (isset($_GET['reward'])){ $username = $_SESSION['username']; $points = $_SESSION['points']; if ($points >=500) { echo " test value is more than 500"; } // ANTRA IF UZDAROM else { echo '<script type="text/javascript">'; echo 'setTimeout(function () { swal({type: "error",title: "Oops...",text: "You do not have enough points!",buttonsStyling: false,heightAuto: false});'; echo '}, 1000);</script>'; } } // PIRMA IF UZDAROM

我为什么要删除它?好吧,由于人们可以刷新页面,因此他们可能会滥用某些内容。有什么办法?

3 个答案:

答案 0 :(得分:0)

使用重定向是您可以尝试的一种选择:

date

答案 1 :(得分:0)

对于将来的读者:

将此代码放在页面顶部

<script>    
    if(typeof window.history.pushState == 'function') {
        window.history.pushState({}, "Hide", '<?php echo $_SERVER['PHP_SELF'];?>');
    }
</script>

*答应了

答案 2 :(得分:-1)

将JS代码的回声添加到一行:

$csvLinks = array();

        if ($this->request->isPost()) {
            $csvLinks = $this->request->data['csvLinks'];
        }

        $lines = array();
        for($i=0; $i<count($csvLinks); $i+=2) {
            // Make a columns array
            $col = array();
            // Push the values inside the columns array
            array_push($col, $csvLinks[$i]);
            array_push($col, $csvLinks[$i+1]);
            // push the columns array inside the $lines array
            array_push($lines, $col);
        }

       foreach($lines as $line) {
           fputcsv($fp, $line);
       }

<string name="string_text_file">This is huge text...</string> 是您网站的完整域名。

相关问题