HTML form value transfer example through get method

HTML form value transfer example through get method
The google.html interface is as shown in the figure

The code is as shown in the figure: (relatively simple, just an input input box and an input submit button. Note that type is submit, not button)

Copy code
The code is as follows:

<html>
<head>
<title>Winbobo</title>
</head>
<body>
<div align="center">
<form action="google.php" method="get">
<input name="q" type="text"/>
</br>
<input name="btnSearch" type="submit" value="Search" />
</form>
</div>
</body>
</html>

The code of google.php is as follows: ($_GET is used to obtain the data passed by the form through the get method; $_POST is used to obtain the data passed by the form through the post method)

Copy code
The code is as follows:

<?php
print "<pre>";
print_r($_GET);
print "</pre>";
?>

The running results are shown in the figure:

<<:  Five guidelines to help you write maintainable CSS code

>>:  MySQL date and time addition and subtraction sample code

Recommend

Vue+Element realizes paging effect

This article example shares the specific code of ...

How to implement variable expression selector in Vue

Table of contents Defining the HTML structure Inp...

Solve the problem that ElementUI custom CSS style does not take effect

For example, there is an input box <el-input r...

Detailed explanation of the cache implementation principle of Vue computed

Table of contents Initialize computed Dependency ...

Implementation of Grid common layout

No gaps on both sides, gaps between each column w...

How to display texture at the position of swipe in CocosCreator

Table of contents 1. Project requirements 2. Docu...

Detailed configuration of Nginx supporting both Http and Https

It is almost a standard feature for websites nowa...

mysql command line script execution example

This article uses an example to illustrate the ex...

WeChat applet implementation anchor positioning function example

Preface In the development of small programs, we ...

Detailed tutorial on installing Docker on CentOS 7.5

Introduction to Docker Docker is an open source c...

Install multiple versions of PHP for Nginx on Linux

When we install and configure the server LNPM env...

Solution to blank page after Vue packaging

1. Solution to the problem that the page is blank...