Warning: file_get_contents(/data/phpspider/zhask/data//catemap/1/php/281.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
我尝试运行php脚本时出错。我不知道为什么_Php_Html - Fatal编程技术网

我尝试运行php脚本时出错。我不知道为什么

我尝试运行php脚本时出错。我不知道为什么,php,html,Php,Html,这是我的php <?php $to = "jacob@codefarms.us, duma@codefarms.us"; $subject = _POST['name']; $content = __POST['content']; $headers = _POST['email']; if (!$content === "") { mail($to,$subject,$content,$headers);

这是我的php

    <?php
      $to = "jacob@codefarms.us, duma@codefarms.us";
      $subject = _POST['name'];
      $content = __POST['content'];
      $headers = _POST['email'];
      if (!$content === "") {
       mail($to,$subject,$content,$headers);
        }

     ?>

我不明白为什么我会出错。我使用hostgator来托管我的网站。

您需要添加下划线“
”:


post方法应以下划线“
”开头。

$\u post['name']是访问post数组中数据的正确方法。

\u post?RTM:我想应该是$\u Post有人想回答这个问题吗?(它修复了它)关闭它,这个问题是由一个无法再复制的问题或一个简单的印刷错误引起的。虽然类似的问题可能在这里的主题,这是一个解决的方式不太可能帮助未来的读者。这通常可以通过在发布前确定并仔细检查重现问题所需的最短程序来避免。
   Warning: Illegal string offset 'name' in 
/*****/*******/codefarms.us/contact.php on line 5

 Warning: Illegal string offset 'content' in 
 /*****/*******/codefarms.us/contact.php on line 6

 Warning: Illegal string offset 'email' in 
 /*****/*******/codefarms.us/contact.php on line 7
$name = $_POST['name'];