How to get the parameters submitted by get in php

(*-*)浩
Release: 2023-02-25 17:46:01
Original
13802 people have browsed it

In PHP, if you want to obtain the data submitted through the get method, you can obtain it through the $_GET object (although the parameters can be viewed in the address bar)

How to get the parameters submitted by get in php

HTML code: The following is a simple form code to submit data to 01.php, using the get method (recommended learning: PHP video tutorial)

<form action="01.php" method="get" >
  <label for="">姓名:
      <input type="text" name= "userName"></label>
      <br/>
  <label for="">邮箱:
      <input type="text" name= "userEmail"></label>
      <br/>
      <input type="submit" name="">
</form>
Copy after login

PHP code:

<?php 
    echo "<h1>GET_PAGE</h1>";
    echo &#39;userName:&#39;.$_GET[&#39;userName&#39;];
    echo &#39;<br/>&#39;;
    echo &#39;userEmail:&#39;.$_GET[&#39;userEmail&#39;];
 ?>
Copy after login

How to get the parameters submitted by get in php

The above is the detailed content of How to get the parameters submitted by get in php. For more information, please follow other related articles on the PHP Chinese website!

Related labels:
php
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