Form中的Action是打印文件名而不是调用action的php文件?

时间:2011-09-19 00:06:16

标签: php eclipse eclipse-pdt

我是php编程的新手,特别是在eclipse中。我遇到了以前没有发生的这个问题。

我的文件名为index.php,我只有一个名为index.php的文件,我有这个非常简单的代码。基本上我的代码只是自称:

<form id="form1" name="form1" method="post" action='index.php'>
      <label>

  <input name="textfield" type="text" id="textfield" />
  </label>
      <label>
      <input type="submit" name="submitcontent" id="submitcontent" value="extract files" />
      </label>
    </form>

当我运行代码并单击提交按钮时,输出是一个带有字符串“index.php”的白页,而不是像我放入操作请求那样重新加载index.php。我花了几个小时试图找到错误而没有希望。

你能告诉我什么是我的错误吗,

让我感到疑惑的是,如果我在Dreamweaver中运行此代码,它可以正常工作,即重新加载index.php,因为它应该这样做。

非常感谢

//编辑:以下是请求的完整代码..

在eclipse中我使用debug作为PHP脚本。这有关系吗?

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head></head>

<body class="twoColLiqLtHdr">

    <form id="form1" name="form1" method="post" action='index.php'>
      <label>
      <input name="textfield" type="text" id="textfield" />
      </label>
      <label>
      <input type="submit" name="submitcontent" id="submitcontent" value="extract files" />
      </label>
    </form>
</body>
</html>

谢谢

1 个答案:

答案 0 :(得分:0)

我已经解决了这个问题。所以这是我犯的错误:

1-我的问题不是PHP或Eclipse,而是服务器。我的调试器配置不正确。

2-我正在使用PHP脚本而不是PHP网页进行调试。前者可以调试而无需连接到服务器(只是一个脚本),而后者可以调试服务器上的网页。

一旦我确保使用php -m正确设置我的调试器,那么设置PDT就是小菜一碟。