代码之家  ›  专栏  ›  技术社区  ›  objectively C

PHP简单Post-Post参数为空[重复]

  •  0
  • objectively C  · 技术社区  · 6 年前

    我在做一个简单的复习申请。下图是我的数据库架构:

    enter image description here

    下面是我用来接受post请求的PHP:

    if ($_SERVER["REQUEST_METHOD"] == "POST") {
        $name = ($_POST["name"]);
        $title1 = ($_POST["phone"]);
        $title2 = ($_POST["myphone"]);
        // check if name only contains letters and whitespace
        $image = ($_POST["stars"]);
        // check if name only contains letters and whitespace
    
        mysql_query("insert into `PeerReview` 
                            ( `ReviewerPhoneNumber`, `RevieweePhoneNumber`, 
                              `RevieweeName`, `Comments`, `Stars` ) 
                    values ( '".$title2."', '".$title1."', '".$name."', '".$image."', '".$image."')");
        if (mysql_error()) {
            die(mysql_error());
    
            echo '
                 <div class="post" style="border-bottom:1px black solid;">
                  <h3>Thank You!</h3>
                  </div>
                  </body>
                  </html>';
            die();
        }
    }
    

    我正在使用邮递员发送邮寄请求:

    enter image description here

    0 回复  |  直到 6 年前