<?php header("X-XSS-Protection: 0; mode=block"); ?> <html> <head> <meta http-equiv="Content-Type" content="text/html; charset=utf-8" /> <title>XSS利用輸出的環境來構造代碼</title> </head> <body> <center> <h6>把咱們輸入的字符串 輸出到input裏的value屬性裏</h6> <form action="" method="get"> <h6>請輸入你想顯現的字符串</h6> <input type="text" name="xss_input_value" value=""><br> <input type="submit"> <!-- 輸入 1231"><script scr=1.js"></script>--> </form> <hr> <?php $xss = $_GET['xss_input_value']; if(isset($xss)){ echo '<input type="text" value="'.$xss.'">'; }else{ echo '<input type="type" value="test" >'; } ?> </center> </body> </html>