当前位置:知识百科 > 正文

htm提交数据给php

更新时间:2026-03-18 13:58 阅读量:120

试试这个?也许是写作不规范?

html

body

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

input type="text" name="name"

input type="submit" value="s"

"ubmit

/form

/body

/html

//test.php

php

$name=$_POST["name"];

echo $name;

导致错误原因多种,需要具体问题具体分析

转的.说明一个问题,就是 你的 apache 和 php 有问题. 或者你的php有问题.

试着提交到空php文件,看出错不.

就是 php文件里只写一个

phpinfo();

想实现htm页面加载的时候传值给指定的php页面,但是页面不跳转

a.htm中的内容:

HTML xmlns=""

head/head

form id="form1"

input id="txtHint" type="text" value="" /

input type="button" onclick="showHint()" value="确定"/

script

function showHint()

{

var str = document.getElementById("txtHint").value;

var xmlhttp;

if (str.length==0)

document.getElementById("txtHint").innerHTML="";

return;

}

if (window.XMLHttpRequest)

xmlhttp=new XMLHttpRequest();

else

xmlhttp=new ActiveXObject("Microsoft.XMLHTTP");

xmlhttp.onreadystatechange=function()

document.getElementById("txtHint").innerHTML=xmlhttp.responseText;

xmlhttp.open("GET","b.php?a="+str,true);

xmlhttp.send();

/script

b.php中的内容:

$a = $_GET["a"];

$b = "yes".$a;

echo $b;

如果是在加载a.htm的时候给b.php传值,那么要把方法写到body中,

即body onload="showHint()"

html传输到php数据?

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

急!html提交数据给php,用php生成图片,如何在html中显示?

首先要确定图片已经生成出来了.

不知生成的图片是否保存成文件了,如果保存成了文件直接img src=""显示即可

如果没有生成图片文件,可以采取一种get模式的传值方式.需要三个文件.

第一个文件HTML文件此文件中放表单

仅供参考,如果有其他问题请补充说明.

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"?/

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

以上就是能诗百科小编为大家整理的htm提交数据给php相关主题介绍,如果您觉得小编更新的文章只要能对粉丝们有用,就是我们最大的鼓励和动力,不要忘记讲本站分享给您身边的朋友哦!!