0

这是我请求反馈的 html 表单。

相应的 PHP 表单将放置在我的网络服务器上以发送电子邮件吗?我是网站设计新手,只学过 CSS+ HTML。

<table width="518" border="0">
          <tr>
            <td width="165"><form name="form1" method="post" action="">
              <label for="nameco">Name/Company</label>
            :
            </form></td>
            <td width="343"><input name="nameco" type="text" id="nameco" size="70"></td>
          </tr>
          <tr>
            <td><form name="form2" method="post" action="">
              <label for="area">Area you are located :</label>
            </form></td>
            <td><input name="area" type="text" id="area" size="70"></td>
          </tr>
          <tr>
            <td><form name="form3" method="post" action="">
              Products interested in :
            </form></td>
            <td><table width="198">
              <tr>
                <td width="190"><label>
                  <input type="radio" name="Product" value="awnings" id="Product_0">
                  Awnings</label></td>
                </tr>
              <tr>
                <td><label>
                  <input type="radio" name="Product" value="carport" id="Product_1">
                  Carport/Shadeport</label></td>
                </tr>
              <tr>
                <td><label>
                  <input type="radio" name="Product" value="patio" id="Product_2">
                  Patio</label></td>
                </tr>
              <tr>
                <td><label>
                  <input type="radio" name="Product" value="other" id="Product_5">
                  Other
                  <input type="text" name="other1" id="other1">
                  </label></td>
                </tr>
            </table></td>
          </tr>
          <tr>
            <td><form name="form4" method="post" action="">
              <label for="contactno">Contact Number :</label>
            </form></td>
            <td><input name="contactno" type="text" id="contactno" size="70"></td>
          </tr>
          <tr>
            <td><form name="form5" method="post" action="">
              <label for="email">Email Address :</label>
            </form></td>
            <td><input name="email" type="text" id="email" size="70"></td>
          </tr>
          <tr>
            <td><form name="form7" method="post" action="">
              <label for="Comments">Additional Comments :</label>
            </form></td>
            <td><input name="Comments" type="text" id="Comments" size="70"></td>
          </tr>
          <tr>
            <td><form name="form8" method="post" action="">
              <input type="submit" name="Submit" id="Submit" value="Submit">
            </form></td>
            <td><form name="form9" method="post" action="">
              <input type="submit" name="reset" id="reset" value="Reset Form">
            </form></td>
          </tr>
        </table>

这是来自 Dreamweaver 的。我如何让表单知道通过这个 PHP 文件发送?

4

1 回答 1

1

如果我可以给你建议,不要使用这么多表格,只需使用一个并设置actionsend.php.

send.php看起来像这样:

<?php
$to = "$_POST['email']";
$subject = "$_POST['subject']";
$message = "$_POST['message']";
$from = "your@email.com";
$headers = "From:" . $from;
mail($to,$subject,$message,$headers);
echo "Mail Sent.";
?>
于 2013-07-21T22:33:02.950 回答