PHP $_GET

巴扎黑
Release: 2016-11-12 09:32:29
Original
2147 people have browsed it



PHP $_GET can also be used to collect form data after submitting an HTML form (method="get").

$_GET can also collect data sent in the URL.

Suppose we have a page containing hyperlinks with parameters:

<html>
<body>
<a href="test_get.php?subject=PHP&web=W3school.com.cn">测试 $GET</a>
</body>
</html>
当用户点击链接 "Test $GET",参数 "subject" 和 "web" 被发送到 "test_get.php",然后您就能够通过 $_GET 在 "test_get.php" 中访问这些值了。
下面的例子是 "test_get.php" 中的代码:
实例
<html>
<body>
<?php 
echo "Study " . $_GET[&#39;subject&#39;] . " at " . $_GET[&#39;web&#39;];
?>
</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!