putting a php variable in a HTML form value

后端 未结 2 870
猫巷女王i
猫巷女王i 2020-12-08 05:04

I\'ve got a php variable like so.. $name = $_REQUEST[\'name\']; I\'d like to put it in a HTML form field\'s value e.g in here..

2条回答
  •  太阳男子
    2020-12-08 05:44

    You can do it like this,

    
    

    But seen as you've taken it straight from user input, you want to sanitize it first so that nothing nasty is put into the output of your page.

    
    

提交回复
热议问题