hidden field in php

后端 未结 3 2078
庸人自扰
庸人自扰 2020-12-20 12:51

For hidden fields, can i use a field of the type

\"/>

an

3条回答
  •  南笙
    南笙 (楼主)
    2020-12-20 13:10

    You absolutely can, I use this approach a lot w/ both JavaScript and PHP.

    Field definition:

    
    

    Access w/ PHP:

    $_GET['foo'] or $_POST['foo']
    

    Also: Don't forget to sanitize your inputs if they are going into a database. Feel free to use my routine: https://github.com/niczak/PHP-Sanitize-Post/blob/master/sanitize.php

    Cheers!

提交回复
热议问题