dozan0001 2013-04-26 11:53
浏览 7
已采纳

PHP联系表单未提交textarea [关闭]

I have tried looking at other related questions, and I have even asked some developer friends for help, but nothing has helped me fix my contact form. I have a basic PHP form, but on submit, I am missing the message textarea field in the email.

FORM CODE:

<form action="sendContactForm.php" method="post">
                <div class="row">
                    <div class="small-12 large-12">
                        <div class="row formRow">
                            <div class="small-3 large-3 columns">
                                <label for="name" class="right inline">Name</label>
                            </div>
                            <div class="small-9 large-9 columns">
                                <input name="name" type="text" id="name" placeholder="Firstname Lastname">
                            </div>
                        </div>
                    </div>
                </div>
                <div class="row">
                    <div class="small-12 large-12">
                        <div class="row formRow">
                            <div class="small-3 large-3 columns">
                                <label for="email" class="right inline">Email</label>
                            </div>
                            <div class="small-9 large-9 columns">
                                <input name="email" type="text" id="email" placeholder="you@email.com">
                            </div>
                        </div>
                    </div>
                </div>
                <div class="row">
                    <div class="small-12 large-12">
                        <div class="row formRow">
                            <div class="small-3 large-3 columns">
                                <label for="company" class="right">Company Name</label>
                            </div>
                            <div class="small-9 large-9 columns">
                                <input name="company" type="text" id="company" placeholder="eg: Apple, Google, Microsoft">
                            </div>
                        </div>
                    </div>
                </div>
                <div class="row">
                    <div class="small-12 large-12">
                        <div class="row formRow">
                            <div class="small-3 large-3 columns">
                                <label for="description" class="right inline">Details</label>
                            </div>
                            <div class="small-9 large-9 columns">
                                <textarea name="description" id="description" placeholder="Please say a few words about why you are contacting me. If this is a project request, some good things to include are: project type, budget, deadline, and expected results."></textarea>
                            </div>
                        </div>
                    </div>
                </div>
                <div class="row">
                    <div class="small-12 large-12">
                        <div class="row formRow">
                            <div class="small-12 large-9 large-offset-3 columns">
                                  <input type="submit" name="submit" value="Submit" class="button expand"/>
                            </div>
                        </div>
                    </div>
                </div>
            </form>

PHP CODE:

<?php
   // from the form
   $name = trim(strip_tags($_POST['name']));
   $email = trim(strip_tags($_POST['email']));
   $company = trim(strip_tags($_POST['company']));
   $message = $_POST['message'];
   $body = $name."
".$company."
".$message."
";
   // set here
   $subject = "Contact form submitted!";
   $to = 'kempfjj@gmail.com';



   $headers = "From: $email
";
   $headers .= "Content-type: text/html
";

   // send the email
   mail($to, $subject, $body, $headers);

   // redirect afterwords, if needed
   header('Location: index.html');

?>

I would really appreciate any help that a professional could give me on this.

  • 写回答

2条回答 默认 最新

  • dsio68964998 2013-04-26 11:57
    关注
    <textarea name="description" id="description"
    

    while getting you are using different variable, change

     $message = $_POST['message'];
    

    into

    $message = $_POST['description'];
    
    本回答被题主选为最佳回答 , 对您是否有帮助呢?
    评论
查看更多回答(1条)

报告相同问题?

悬赏问题

  • ¥15 请教一下各位,为什么我这个没有实现模拟点击
  • ¥15 执行 virtuoso 命令后,界面没有,cadence 启动不起来
  • ¥50 comfyui下连接animatediff节点生成视频质量非常差的原因
  • ¥20 有关区间dp的问题求解
  • ¥15 多电路系统共用电源的串扰问题
  • ¥15 slam rangenet++配置
  • ¥15 有没有研究水声通信方面的帮我改俩matlab代码
  • ¥15 ubuntu子系统密码忘记
  • ¥15 保护模式-系统加载-段寄存器
  • ¥15 电脑桌面设定一个区域禁止鼠标操作