Home > php教程 > php手册 > body text

浅谈php提交form表单

WBOY
Release: 2016-06-06 20:02:38
Original
1064 people have browsed it

这篇文章主要介绍了浅谈php提交form表单的2种方法和简单的示例,十分的实用,有需要的小伙伴可以参考下。

处理GET请求

实现的功能是输入姓名后页面显示“Hello XXX”

创建html文件hello.html:

欢迎

创建PHP文件hello.php:

Get请求把表单的数据显式地放在URI中,并且对长度和数据值编码有所限制,,如:

处理POST请求

实现一个简单的加法运算功能

创建html文件add.html:

相加
+

创建PHP文件add.php:

Post请求把表单数据放在http请求体中,并且没有长度限制

form action=""意思是:form是表单,action是转向地址,即form表单需要提交到哪里

以上所述就是本文的全部内容了,希望大家能够喜欢。

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 Recommendations
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!