


Web Development N Examples - Case 3: Using post and get methods to pass parameters between php and html
N examples of web development
Case 3: Use post and get methods to pass parameters between php and html
case3.php:
<!DOCTYPE html> <html> <head> <!-- 请将文档保存为UTF-8编码,否则中文会乱码 --> <meta charset="UTF-8"> <title>案例3</title><!-- 使用post和get方法在php和html间传递参数 --> </head> <body> <!-- 使用get方法传递 --> <form action="case3-output.php" method="get"> get提交的数据:<input type="text" name="getText"> <input type="hidden" name="getHidText" value="get隐藏文字"> <input type="submit" name="g_sb"><!--提交按钮,只有提交了才能够传递表单参数--> </form> <!-- 通过url直接传递,也属于get方法 --> <a href="case3-output.php?urlText=传递文字">点击超链接传递参数</a> <!-- 使用post方法传递 --> <form action="case3-output.php" method="post"> post提交的数据:<input type="text" name="postText" > <input type="hidden" name="postHidText" value="post隐藏文字"> <input type="submit" name="p_sb"><!--提交按钮,只有提交了才能够传递表单参数--> </form> </body> </html>
case3-output.php:
<?php if(isset($_GET["getText"])) echo "get传递的数据为:{$_GET['getText']}<br>"; else echo "没有通过get传递数据<br>"; if(isset($_GET["getHidText"])) echo "get传递的隐藏数据为:{$_GET['getHidText']}<br>"; else echo "没有通过get传递隐藏数据<br>"; if(isset($_GET["urlText"])) echo "url传递的数据为:{$_GET['urlText']}<br>"; else echo "没有通过url传递数据<br>"; if(isset($_POST["postText"])) echo "post传递的数据为:{$_POST['postText']}<br>"; else echo "没有通过post传递数据<br>"; if(isset($_POST["postHidText"])) echo "post传递的隐藏数据为:{$_POST['postHidText']}<br>"; else echo "没有通过post传递隐藏数据<br>";
Very commented It’s detailed and no further explanation is needed.
The above has introduced N examples of web development - Case 3: using the post and get methods to pass parameters between php and html, including the relevant content. I hope it will be helpful to friends who are interested in PHP tutorials.

Hot AI Tools

Undresser.AI Undress
AI-powered app for creating realistic nude photos

AI Clothes Remover
Online AI tool for removing clothes from photos.

Undress AI Tool
Undress images for free

Clothoff.io
AI clothes remover

Video Face Swap
Swap faces in any video effortlessly with our completely free AI face swap tool!

Hot Article

Hot Tools

Notepad++7.3.1
Easy-to-use and free code editor

SublimeText3 Chinese version
Chinese version, very easy to use

Zend Studio 13.0.1
Powerful PHP integrated development environment

Dreamweaver CS6
Visual web development tools

SublimeText3 Mac version
God-level code editing software (SublimeText3)

Hot Topics



Many users will choose the Huawei brand when choosing smart watches. Among them, Huawei GT3pro and GT4 are very popular choices. Many users are curious about the difference between Huawei GT3pro and GT4. Let’s introduce the two to you. . What are the differences between Huawei GT3pro and GT4? 1. Appearance GT4: 46mm and 41mm, the material is glass mirror + stainless steel body + high-resolution fiber back shell. GT3pro: 46.6mm and 42.9mm, the material is sapphire glass + titanium body/ceramic body + ceramic back shell 2. Healthy GT4: Using the latest Huawei Truseen5.5+ algorithm, the results will be more accurate. GT3pro: Added ECG electrocardiogram and blood vessel and safety

If you are an IT administrator or technology expert, you must be aware of the importance of automation. Especially for Windows users, Microsoft PowerShell is one of the best automation tools. Microsoft offers a variety of tools for your automation needs, without the need to install third-party applications. This guide will detail how to leverage PowerShell to automate tasks. What is a PowerShell script? If you have experience using PowerShell, you may have used commands to configure your operating system. A script is a collection of these commands in a .ps1 file. .ps1 files contain scripts executed by PowerShell, such as basic Get-Help

Why Snipping Tool Not Working on Windows 11 Understanding the root cause of the problem can help find the right solution. Here are the top reasons why the Snipping Tool might not be working properly: Focus Assistant is On: This prevents the Snipping Tool from opening. Corrupted application: If the snipping tool crashes on launch, it might be corrupted. Outdated graphics drivers: Incompatible drivers may interfere with the snipping tool. Interference from other applications: Other running applications may conflict with the Snipping Tool. Certificate has expired: An error during the upgrade process may cause this issu simple solution. These are suitable for most users and do not require any special technical knowledge. 1. Update Windows and Microsoft Store apps

Python simulates the browser sending post requests importrequests format request.postrequest.post(url,data,json,kwargs)#post request format request.get(url,params,kwargs)#Compared with get request, sending post request parameters are divided into forms ( x-www-form-urlencoded) json (application/json) data parameter supports dictionary format and string format. The dictionary format uses the json.dumps() method to convert the data into a legal json format string. This method requires

For PHP developers, using POST to jump to pages with parameters is a basic skill. POST is a method of sending data in HTTP. It can submit data to the server through HTTP requests. The jump page processes and jumps the page on the server side. In actual development, we often need to use POST with parameters to jump to pages to achieve certain functional purposes.

PHP is a widely used server-side scripting language that can be used to create interactive and dynamic web applications. When developing PHP applications, we usually need to submit user input data to the server for processing through forms. However, sometimes we need to determine whether form data has been submitted in PHP. This article will introduce how to make such a determination.

1. Java calls post interface 1. Use URLConnection or HttpURLConnection that comes with java. There is no need to download other jar packages. Call URLConnection. If the interface response code is modified by the server, the return message cannot be received. It can only be received when the response code is correct. to return publicstaticStringsendPost(Stringurl,Stringparam){OutputStreamWriterout=null;BufferedReaderin=null;StringBuilderresult=newSt

实现如下:server{listen80;listen443ssl;server_namenirvana.test-a.gogen;ssl_certificate/etc/nginx/ssl/nirvana.test-a.gogen.crt;ssl_certificate_key/etc/nginx/ssl/nirvana.test-a.gogen.key;proxy_connect_timeout600;proxy_read_timeout600;proxy_send_timeout600;c
