html提交数据到php html传值给php

html 中的值怎么传送给php使用

通过表单,例如:

公司专注于为企业提供网站设计、网站制作、微信公众号开发、电子商务商城网站建设,微信小程序,软件按需网站建设等一站式互联网企业服务。凭借多年丰富的经验,我们会仔细了解各客户的需求而做出多方面的分析、设计、整合,为客户设计出具风格及创意性的商业解决方案,创新互联建站更提供一系列网站制作和网站推广的服务。

form action="form_action.php method="get"

pFirst name: input type="text" name="fname" //p

pLast name: input type="text" name="lname" //p

input type="submit" value="Submit" /

/form

其中的input 中的 name 就可以被PHP接收

HTML代码 和PHP代码在一个页面。怎么把html里的表单数据提交给php

test.php页面

判断该页是否提交,如果提交了,就按照正常的接受数据来就行了。

?php

if($_POST){

$words = $_POST["words"];

if ($words) {

echo "收到";

}

}

?

!DOCTYPE html

html lang="en"

head

meta charset="UTF-8"

titleDocument/title

/head

body

form action="test.php" method="post"

input type="text" name="words"

input type="submit" name="" value="提交"

/form

/body

/html

html传值给php

html

head

meta http-equiv="Content-Type" content="text/html; charset=utf-8" /

title无标题文档/title

/head

body

form action="" method="get"

Name: input type="text" name="name" /

input type="submit" /

/form

?php

$name=$_GET['name'];

echo "欢迎你:".$name;

?

/body

/html

html传输到php数据?

这个需要使用php中的$_REQUEST["code"]全局变量的方式,据可以获取到HTML传输过来的数据了。


网站栏目:html提交数据到php html传值给php
分享路径:http://ybzwz.com/article/dddigcc.html