将文本值从html页面传递到php页面


Passing text value from html page to php page

我知道这个问题和其他问题类似,我做了几个小时的研究,但我无法找到解决方案,请帮我找到解决方案。

我想将文本字段值从html传递到php文本字段,但php代码显示为输出,而不是值。

第1页:

<body>
<form action="fare1.php" method="post">

  <input name="address1" id="address1" type="text" size="15" value="City" /> 
  <input name="" type="submit" />
    </form>
</body>

第2页:

<body>
  <div class="content">
    <h1>Instructions</h1>
    <table width="200">
  <tr>
    <td colspan="2">
      <input type="text" name="from" id="from" value="<?php echo $_POST['address1'];     ?>" /></td>
  </tr> 
</table>
     <!-- end .content --></div>  
</body>

我尝试使用隐藏字段,使用javascript函数和许多其他东西,但我无法找到解决问题的方法:(

谢谢!

编辑。。。

我似乎对PHP本身有问题,我现在正在努力解决它。PHP没有在我的系统中运行。如果你知道任何提供php支持的免费托管网站,请让我知道,我尝试了50web,它正在保存php文件,而不是打开它。

谢谢!

如果php在服务器上运行,则fare1.php应在不显示任何php代码的情况下执行输出。如果是,那么您的服务器不支持php。我建议你下载examplep。它是一个免费开放的web服务器,支持php。