form validation
PHP Form Validation
In this chapter we will introduce how to use PHP to verify form data submitted by the client.
We need to consider security when processing PHP forms.
In this chapter we will demonstrate the secure processing of PHP form data. In order to prevent hackers and spam, we need to perform data security verification on the form.
The HTML form introduced in this chapter contains the following input fields: Must and optional text fields, radio buttons, and submit buttons:
php.cn
First let us look at pure HTML first Form code:
Text field
"名字", "E-mail", 及"网址"字段为文本输入元素,"备注"字段是 textarea。HTML代码如下所示: “名字”: E-mail: 网址: 备注:
Radio button
The "Gender" field is a radio button, HTML code As shown below:
Gender:
Female
Male
Form elements
HTML form code is as follows Display: