【问题标题】:Sanitizing url parameters清理 url 参数
【发布时间】:2016-06-03 20:35:35
【问题描述】:

抱歉,发了一个不正确的问题,很快就会更新。

【问题讨论】:

    标签: php security xss


    【解决方案1】:

    我想你在找htmlentities

    我会将其设置为中间变量,因为您稍后将使用 $_REQUEST 数组而不是 $_GET

    $id = urlencode(htmlentities($_GET['id']));
    

    后来

    <a href="https://test.com/page2.php?id=<?php print $id; ?>">Link</a>
    

    【讨论】:

      猜你喜欢
      • 2015-04-10
      • 2014-01-08
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 2020-04-14
      • 1970-01-01
      • 2016-03-08
      相关资源
      最近更新 更多