Mark row: Represented by formgt. this marking row must contain the action attribute and method attribute. The action attribute provides the form with the url or path of another program (which can be the current file ), so that the program can be extracted from the form... mark row: use
First: send variables through url
Example: http://www.phprm.com/news/list.php? Id = 123 & lang = en
Id = 123 is the news parameter, and lang = en indicates that the language is English, so we can get the id and lang value through php $ _ get, for example, to retrieve the id value, you only need $ _ get ['id'] to get the id value. The same is true for lang.
Disadvantages of passing values through URLs:
1. everyone can see the value of the variable. Therefore, it is not safe to transmit sensitive data in this way.
2. you can modify the values in the url at will and try different combinations to display the information we do not want to display after opening the website.
3. the user may also use the long-saved url and the old variables embedded in it to extract incorrect or outdated information.
Second: transfer variables through sessions
If the information is not so sensitive or static, you can use a url to transmit values. However, if you want to transmit user name, password, or other personal information, it is best to keep privacy during transmission. for example, you can use cookies or sessions. (personal thoughts, because it is re-learning ~ First talk about the session ).
A session only contains a set of temporary variables before the browser closes. the session information includes the session id, and whether the authorized individual logs on to the site or not. this information is temporarily stored for php for use as needed.
If the user is forced to use cookies to send variables, set session. use_only_cookies = 1 in php. ini.
In addition, make sure that php. the INI file has been modified, that is, session. save_path indicates the valid path. then, you only need to call the session_start () function (before all the output statements written on this page) to start a session in php.
Example: File 1, test_1.php
test1
Test2.php
my movie site -<?php echo $_get['favmovie'];
'; ?>
Third: use cookies to send variables
The use of cookies has potential security risks. hackers can use cookies to obtain and exploit the information you have left on the web. Therefore, it is best not to store personal information on computers.
Because the visitor may choose to disable the cookie function or delete the cookie on the computer, from the perspective of development, using the cookie information is not the best method. the code is as follows:
......
Address:
Reprinted at will, but please attach the article address :-)