0

我有一个联系销售表格。我想在我的电子邮件 ID 中获取此表格数据,当此人填写值时,所有值数据都以电子邮件中的表格形式显示给我。我使用了以下代码,这些代码不显示用户 html 输入的值:

 <tr>
        <td width="298">First Name <span style="color:#FF0000">*</span></td>
        <td width="37">&nbsp;</td>
        <td width="297">Last Name <span style="color:#FF0000">* </span></td>
      </tr>
      <tr>
        <td><input type="text" name="fname" class="saleform" /></td>
        <td>&nbsp;</td>
        <td><input type="text" name="lname" class="saleform" /></td>
      </tr>
      <tr>
        <td>Company <span style="color:#FF0000">* </span></td>
        <td rowspan="2">&nbsp;</td>
        <td>Job Title <span style="color:#FF0000">* </span></td>
      </tr>
      <tr>
        <td><input type="text" name="company" class="saleform" /></td>
        <td><input type="text" name="job" class="saleform" /></td>
      </tr>
      <tr>
        <td>Phone No <span style="color:#FF0000">* </span></td>
        <td>&nbsp;</td>
        <td>Email Id <span style="color:#FF0000">* </span></td>
      </tr>
      <tr>
        <td><input type="text" name="phone" class="saleform" /></td>
        <td>&nbsp;</td>
        <td><input type="text" name="email" class="saleform" /></td>
      </tr>

      <tr>
        <td>Comment and Question<span style="color:#FF0000"> *</span></td>
        <td>&nbsp;</td>
        <td>&nbsp;</td>
      </tr>
      <tr>
        <td colspan="3"><inp/td>
          <textarea name="messages" class="saleform" style="width:647px; height:100px;"></textarea></td>
      </tr>
      <tr>
        <td><input type="submit"  class="button" value="Submit" align="left" style="margin-right:9px;" />
          <input name="button2" type="reset"  class="button" style="margin-right:9px;" value="Clear" align="left" /></td>
        <td>&nbsp;</td>
        <td width="297">&nbsp;</td>
      </tr>
    </table>

    </form>
4

1 回答 1

0

请在下面使用:)并自定义:)

<html>
<body>

<?php
if (isset($_REQUEST['email']))
//if "email" is filled out, send email
  {
  //send email
  $email = $_REQUEST['email'] ;
  $subject = $_REQUEST['subject'] ;
  $message = $_REQUEST['message'] ;
  mail("someone@example.com", $subject,
  $message, "From:" . $email);
  echo "Thank you for using our mail form";
  }
else
//if "email" is not filled out, display the form
  {
  echo "<form method='post' action='mailform.php'>
  Email: <input name='email' type='text'><br>
  Subject: <input name='subject' type='text'><br>
  Message:<br>
  <textarea name='message' rows='15' cols='40'>
  </textarea><br>
  <input type='submit'>
  </form>";
  }
?>

</body>
</html>
于 2013-09-30T10:56:42.757 回答