如何将表单的值传递给另一个表单? [英] How to pass the value of a form to another form?
本文介绍了如何将表单的值传递给另一个表单?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
我有一项任务,我需要将页面中的表单值传递给另一个表单。我正在使用 POST
方法来执行此操作,但它不起作用。我真的很感谢一些帮助。
这是我使用的代码:
第一表格( form2.php
)
< html>
< head>
< title> FORM< / title>
< / head>
< body>
< form action =form3.phpmethod =post>
名称:< input type =textname =name>
地址:< input type =textname =address>
< input type =submitname =Submitvalue =submit>
< / form>
< / body>
< / html>
第二表格( form3.php
)
< html>
< head>
< title>我的主页< / title>
< / head>
< body>
<?php
$ x = $ _ POST ['name'];
$ y = $ _ POST ['address'];
echo $ x;
echo $ y;
?>
< / body>
< / html>
解决方案
看来你使用的是linux环境下的表单动作( form3.php
)和文件名( Form3.php
em>)不一样。在Linux环境中,这些区分大小写。请采取行动uri&文件名相同的情况下。
I have a task in which I need to pass the value of a form in a page to another one. I am using POST
method to do this, but it is not working. I would really appreciate some help.
This is the code I am using:
First Form (form2.php
)
<html>
<head>
<title>FORM</title>
</head>
<body>
<form action="form3.php" method="post">
Name:<input type="text" name="name">
Address:<input type="text" name="address">
<input type="submit" name="Submit" value="submit">
</form>
</body>
</html>
Second Form (form3.php
)
<html>
<head>
<title>MY HOMEPAGE</title>
</head>
<body>
<?php
$x=$_POST['name'];
$y=$_POST['address'];
echo $x;
echo $y;
?>
</body>
</html>
解决方案
It seems you are using linux environment, the form action (form3.php
) and file name (Form3.php
) are not same. In linux environment these are case sensitive. Please make action uri & file name in same case.
这篇关于如何将表单的值传递给另一个表单?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文