Php html/css 联系表帮助

Php help for html/css contact form

我对编码很陌生,我正在尝试使用此处的代码设置联系表:http://codepen.io/rexkirby/pen/Fdnlz

我现在需要让它发挥作用,但对 php 的了解为 0。我尝试了很多不同的 php 代码,但我什至不知道如何将 link 文件 html 正确地转换为 .php 文件。我的代码如下,如果有人能告诉我如何 link 文件,我将不胜感激!

HTML:

<div id="form-main">
  <div id="form-div">
    <form class="form" id="form1" action="mail.php" method="post">
      <p class="name">
        <input name="name" type="text" class="validate[required,custom[onlyLetter],length[0,100]] feedback-input" placeholder="Name" id="name" />
      </p>

      <p class="email">
        <input name="email" type="text" class="validate[required,custom[email]] feedback-input" id="email" placeholder="Email" />
      </p>

      <p class="text">
       <textarea name="text" class="validate[required,length[6,300]] feedback-input" id="comment" placeholder="Comment"></textarea>
      </p>
      <div class="submit">
        <input type="submit" value="SEND" id="button-blue"/>
          <div class="ease"></div>
      </div>
    </form>
</div>

Php

    <?php
if (isset($_REQUEST['email']))
//if "email" is filled out, send email
{
    //send email
    $from = $_REQUEST['author'] ;
    $to = $_REQUEST['email'] ;
    $subject = $_REQUEST['subject'] ;
    $message = $_REQUEST['msg'] ;
    mail($to, $subject, $message, "From:" . $from);

    // the mail was sent
    echo "Thank you for using our mail form";
}
else {
    //if "email" is not filled out, display the form
    //just close php and copy the code for your form
?>

首先创建一个名为 mail.php 的文件,并将其放在与 html/css 文件相同的目录中。

mail.php 文件负责处理您的表单,然后将其发送到您希望的任何地方。保存这些文件并在 WAMP/LAMP/XAMP 之类的 Web 服务器或实时服务器(如果有的话)上简单地测试它们。

谢谢!我终于解决了这个问题,结果 GitHub 不支持 php 我托管它的地方