PHP $_REQUEST

巴扎黑
Release: 2016-11-12 09:34:17
Original
2397 people have browsed it


PHP $_REQUEST

PHP $_REQUEST is used to collect data submitted by HTML forms.

The example below shows a form with input fields and a submit button. When a user submits form data by clicking the submit button, the form data is sent to the script file specified in the action attribute of the

tag. In this example, we specify the file itself to handle the form data. If you need to use other PHP files to process form data, please change the file name to the file name of your choice. We can then use the super global variable $_REQUEST to collect the value of the input field:

Instance

<html>
<body>
<form method="post" action="<?php echo $_SERVER[&#39;PHP_SELF&#39;];?>">
Name: <input type="text" name="fname">
<input type="submit">
</form>
<?php 
$name = $_REQUEST[&#39;fname&#39;]; 
echo $name; 
?>
</body>
</html>
Copy after login


Related labels:
source:php.cn
Statement of this Website
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn
Popular Tutorials
More>
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template
About us Disclaimer Sitemap
php.cn:Public welfare online PHP training,Help PHP learners grow quickly!