如何将变量发送到另一个php页面?

如何将变量发送到另一个php页面?,php,Php,test.html <html> <head> <title>test</title> </head> <body> <form name="form1" method="post" action="testout.php"> irum1 : <input type="text" name="irum1" size="20" value=""> <input type="submit" valu

test.html

<html>
<head>
<title>test</title>
</head>
<body>
<form name="form1" method="post" action="testout.php">
irum1 : <input type="text" name="irum1" size="20" value="">
<input type="submit" value="Send">
</form>
</body>
</html>
应该是

getting irum1 = Hello php
以上代码是关于将用户输入的参数发送到另一个页面。但代码不起作用。我看不到参数。我正在用apm(apache+php+mysql)做这项工作。有什么问题?我是php的新手


谢谢。

您正在将值正确地传递到该页,但没有在另一页上检索该值

在您的
testout.php上执行此更改

<html>
<head>
<title>testout</title>
</head>
<body>
  getting irum1 = <?php echo isset($_POST['irum1']) ? $_POST['irum1'] : "Value not passed";?>
</body>
</html>

测试
获取irum1=

提交表单时,通过表单定义的方法发送数据数组。在这种情况下,请发送邮件

您必须先从POST数组中获取“irum1”表单数据,然后才能使用它

关于testout.php

<?php $irum1 = $_POST['irum1'] ?>

<html>
<head>
<title>testout</title>
</head>
<body>
  getting irum1 =  <font color="blue"><?=$irum1?></font>
</body>
</html>

测试
获取irum1=

谢谢。它工作得很好。但与我的php书相比,我输入的是正确的。你能解释一下你的代码和我的代码有什么不同吗?
<html>
<head>
<title>testout</title>
</head>
<body>
  getting irum1 = <?php echo isset($_POST['irum1']) ? $_POST['irum1'] : "Value not passed";?>
</body>
</html>
<?php $irum1 = $_POST['irum1'] ?>

<html>
<head>
<title>testout</title>
</head>
<body>
  getting irum1 =  <font color="blue"><?=$irum1?></font>
</body>
</html>