What is a form? - A form is not a table.
Some html elements where users can provide certain data or information or options. The form usually has a "submit" button, which can then provide this data/information/options to a program on the server for use - data processing.
—The core of the form is data.
The composition and form of form tags:
What are the form items?
Single-line text box:
Other attributes:
value: Set the initial text
size: Set the width of its input box (unit is "character width") - this number of characters can be placed in it
maxlength: Set the maximum number of characters that can be entered in this input box
readonly: This is a "no value" attribute, which means "read only". The writing method is: readonly="readonly"
disable: Set the input box to "invalid", that is, the data is invalid.
Password box:
Other attributes:
value: Set the initial text
size: Set the width of its input box (unit is "character width") - this number of characters can be placed in it
maxlength: Set the maximum number of characters that can be entered in this input box
Single option:
to
Other attributes:possible. It is also a "valueless attribute"
说 NAME special description: The single -option of a group requires that the name value must be the same.
Multiple options:
通 Explanation: Multi -options usually must have a value value;Other attributes:
possible. It is also a "valueless attribute"
Submit button:
交 Explanation: Click the submission button, then the form will be "submitted", that is, the data will be transmitted into the file set by the form of the form.
Image button:
The function of the picture button is actually "submit", but the displayed effect is a picture - this is helpful to beautify the page.
Reset button:
单 Explanation: The data that will be filled in or selected by all users of the form to the initial stateOrdinary button:
没有 Explanation: There is no effect on the form, but "action" can be generated from it to achieve other requirements (JS program)& File domain: & lt; input type = "file" name = "n9" /& gt;
选择 Explanation: allow users to choose local files (and send to the server) -the files are also data.Hidden field:
explained: not visible on the interface, but submitted to the server as a "hidden data" - required for programming.
E Pulling selection: Use Select and Option tag cooperation. But treat this as "a form item"
~ ~ ~
with
The selected attribute can be used on the option tag to indicate the default selected item of the select element (the first item is selected by default).
The multiple attribute can be used on the select tag, so that the select element can "select multiple" (that is, only one can be selected by default)
Multi-line options (also called list options): Multi-line options are actually just a "deformation" of drop-down selection - setting their size value to be greater than or equal to will result in multiple lines.
~ ~
Multi-line text box:
with 的 The number of rows set by ROWS is a number, indicating that the number of texts that can be displayed by the multi -line text box
的 The number of columns set by COLS is a number, indicating that the number of texts that can be displayed by the multi -line text boxThis tag has no value attribute. But its actual "value" is whatever is placed in the middle of this tag.
out out to be stored in the form – all form items must have a name attribute to indicate their "name" - the server retrieves the data based on this name.
Frame Tag
The first concept: We always only display one web page in an open "window".
But:
个 In fact, we can also open multiple web pages in one window -in fact, its essence is still a window to display a web page, but we will use some specific tags to divide a "large window" into several "small windows. ".
First of all, let’s be clear:
1. When using frame tag (frameset), you cannot use body tag - that is, use frameset tag instead of body tag
2. To use the frameset tag, you must use the frameset document type
The specific segmentation code is as follows:
F & lt; Frameset Cols = "Set the current window divided by column" rows = "to set the current window according to the line" & gt;~ ~
. . . . . . . . . . . . .
The value of cols is a continuous number or percentage representing the width of the column, separated by (,), where the "*" sign represents the width of the "rest". For example:
”Cols =" 100,800 ": indicates that the large window is divided into two small windows according to the column, the first is 100 width, and the second is 800 wide’ s to ’ s ’ s 1 t t through ’ ’ s ’ ’ s 1’s 1 100 t-t t t- s s s to be split into 3 small windows according to columns, the first one is 100 wide, the second one is 200 wide, and the rest is given to the third one
cols=”15%, *”
值 The value of ROWS is the number or percentage of the width of the continuous exponential line, which is separated from each other (,), where the "*" indicates the width of the "rest". For example:rows=”100,200,*”
row=”20%, *”
css introduction
CSS: Cascading Style Sheet
CSS allows us to control the appearance of the webpage from the following two aspects:
1. Control the appearance of web pages in batches, allowing us to save labor.
2. Precisely control the appearance of web pages: down to the pixel level.
Basic syntax form of css:
Selector { css attribute name 1: value 1; css attribute name 2: value 2; ………… }
Example:
font{color:red; font-weight:bold; font-size:18px;}
dt{
font-size:14px;
font-weight:bold;
🌜}
A way to differentiate between two attributes
html attribute: written in the tag, in the form: attribute name = "attribute value" - this quotation mark can be omitted, but it is recommended not to omit it for wall cracks
签 -also called "label attribute"—HTML attributes are usually “the own attributes of each tag, which are generally different”
——There are very few tags using the same html attribute
css attribute: written in curly brackets of the selector, in the form: attribute name: attribute value - pay special attention, the value cannot be enclosed in quotes
—can also be called “style attribute”
—CSS properties are usually “available to all tags”, generally the same
——There are very few tags that do not use the same css attributes
Selector Classification
Tag selector:
Format: tag name { …….. }
(Meaning: Refers to the attribute settings in all the labels in the (corresponding) webpage.
Class Selector:
Form: .Class name { …… }
(Meaning: The value of the Class in the (corresponding) webpage is all labels of this type of name apply the attribute settings.Example:
~
ID Selector:
Format: #idname{…… The meaning of (: The value of the ID in the (corresponding) webpage is that the label that names the name is set to the attribute settings.
个 Note: Generally, the ID name in a web page should not be the same, because ID itself means "only".Example:
~
Universal Selector:
Form: *{ ….. } ——Universal selector has only this form (symbol)
Meaning: It automatically refers to "all tags", that is, all tags apply this attribute setting
器 Note: The general choice device is used with caution, which is usually used only to set up a few basic attributes, such as text color, text size, padding, marginPseudo class selector:
Form: :pseudo class name {……}
Note: There are actually only a few pseudo-class names stipulated within the system and not defined by ourselves, such as: link, visited, hover, active. Their meanings are also specific. Usually the above pseudo-classes are only used for a tags, and their form and meaning are usually:
a:visited{…..} :表示一个a链接标签在点击(访问)过之后的时候的状态(访问后状态)
a:hover{….} :表示一个a链接标签在鼠标放上去的时候的状态(悬停状态)
a:active{….} :表示一个a链接标签在鼠标摁住但还没有抬起的状态(活动状态)。
不过,最新的浏览器中,出于安全考虑,a的hover和visited效果有些属性不能用了。
复合选择器之:层级选择器
形式: 选择器1 选择器2 { ……… }
含义: 在选择器1所对应的标签中由选择器2所对应的那些标签。。。。。其中,选择器1和选择器2可以是前面所学的任意某种选择器,而且这种层级关系还可以多层次,比如:
#d1 div{…}
.cc1 p span{…..}
p .cc2 img{…..}
#d1 p a:hover{….}
举例:
div p{ color: red;}
段落1
Compound selector: group selector
Form: Selector 1, Selector 2 {………… }
Meaning: It means that both selectors use the same attribute settings. In fact, it is nothing more than a way of writing simplified code, otherwise they have to use two selectors to write.
.a {color:red; font-size:15px;}
.b{ color:red; font-size:15px;}
è
.a, .b{ color:red; font-size:15px;}
Other compound forms (examples):
div.cc1{…} : Represents a div tag with class value cc1, which is completely different from div .cc1{…}.
p
Frame:
Frame tags are a technique used to divide the "current window" into smaller windows. framseset replaces the body tag and uses the frame document type.

PHP is used to build dynamic websites, and its core functions include: 1. Generate dynamic content and generate web pages in real time by connecting with the database; 2. Process user interaction and form submissions, verify inputs and respond to operations; 3. Manage sessions and user authentication to provide a personalized experience; 4. Optimize performance and follow best practices to improve website efficiency and security.

PHP uses MySQLi and PDO extensions to interact in database operations and server-side logic processing, and processes server-side logic through functions such as session management. 1) Use MySQLi or PDO to connect to the database and execute SQL queries. 2) Handle HTTP requests and user status through session management and other functions. 3) Use transactions to ensure the atomicity of database operations. 4) Prevent SQL injection, use exception handling and closing connections for debugging. 5) Optimize performance through indexing and cache, write highly readable code and perform error handling.

Using preprocessing statements and PDO in PHP can effectively prevent SQL injection attacks. 1) Use PDO to connect to the database and set the error mode. 2) Create preprocessing statements through the prepare method and pass data using placeholders and execute methods. 3) Process query results and ensure the security and performance of the code.

PHP and Python have their own advantages and disadvantages, and the choice depends on project needs and personal preferences. 1.PHP is suitable for rapid development and maintenance of large-scale web applications. 2. Python dominates the field of data science and machine learning.

PHP is widely used in e-commerce, content management systems and API development. 1) E-commerce: used for shopping cart function and payment processing. 2) Content management system: used for dynamic content generation and user management. 3) API development: used for RESTful API development and API security. Through performance optimization and best practices, the efficiency and maintainability of PHP applications are improved.

PHP makes it easy to create interactive web content. 1) Dynamically generate content by embedding HTML and display it in real time based on user input or database data. 2) Process form submission and generate dynamic output to ensure that htmlspecialchars is used to prevent XSS. 3) Use MySQL to create a user registration system, and use password_hash and preprocessing statements to enhance security. Mastering these techniques will improve the efficiency of web development.

PHP and Python each have their own advantages, and choose according to project requirements. 1.PHP is suitable for web development, especially for rapid development and maintenance of websites. 2. Python is suitable for data science, machine learning and artificial intelligence, with concise syntax and suitable for beginners.

PHP is still dynamic and still occupies an important position in the field of modern programming. 1) PHP's simplicity and powerful community support make it widely used in web development; 2) Its flexibility and stability make it outstanding in handling web forms, database operations and file processing; 3) PHP is constantly evolving and optimizing, suitable for beginners and experienced developers.


Hot AI Tools

Undresser.AI Undress
AI-powered app for creating realistic nude photos

AI Clothes Remover
Online AI tool for removing clothes from photos.

Undress AI Tool
Undress images for free

Clothoff.io
AI clothes remover

AI Hentai Generator
Generate AI Hentai for free.

Hot Article

Hot Tools

SublimeText3 Chinese version
Chinese version, very easy to use

MantisBT
Mantis is an easy-to-deploy web-based defect tracking tool designed to aid in product defect tracking. It requires PHP, MySQL and a web server. Check out our demo and hosting services.

PhpStorm Mac version
The latest (2018.2.1) professional PHP integrated development tool

WebStorm Mac version
Useful JavaScript development tools

ZendStudio 13.5.1 Mac
Powerful PHP integrated development environment