access html 5 data attribute in php

后端 未结 2 358
轻奢々
轻奢々 2021-01-22 06:28

I have a form which includes



        
2条回答
  •  无人及你
    2021-01-22 07:21

    Your user ID should be in a separate hidden field, such as:

    
    
    

    Your message input shouldn't have an id of user-id and shouldn't need data-user-id at all.

    Data attributes are used by JavaScript. Hidden inputs pass values to PHP that the user doesn't need to see. Neither are truly hidden to the user.

提交回复
热议问题