php get variables as key with no value assigned

前端 未结 5 1579
执笔经年
执笔经年 2021-01-12 11:45

If I enter the following into the browser:

   http://domain.com/script.php?1234

And script.php has the following script:

           


        
5条回答
  •  庸人自扰
    2021-01-12 12:12

    You shouldn't use this approach. If you don't want your variables to be shown you can use URL rewrite to make the URL look good. Also, don't forget to sanitize your $_GET :)

    Actually, in your example, 1234 is the variable you send through GET, with no value, if you want to look it this way.

提交回复
热议问题