0

我尝试使用 AltoRouter 发送联系表格,但我没有收到任何 POST 内容。

这是我的路线:

$router->map('GET','/kontakt/', 'views/kontakt.php', 'kontakt');
$router->map('POST','/sendContact/', 'views/sendContact.php', 'sendContact');

$match = $router->match();

if($match) {
  require $match['target'];
}
else {
  header("HTTP/1.0 404 Not Found");
}

这是我的表格联系表格

<form name="contactForm" action="./sendContact/" method="post">
      <div class="form-row">
        <div class="form-group col-md-6">
          <label for="inputVorname">Vorname</label>
          <input type="text" class="form-control" id="inputVorname" placeholder="Vorname">
        </div>
</form>

这是 sendContact.php

<?php

var_dump($_POST);

但输出是

数组(0){}

我必须怎么做才能捕获 POST 数据以使用它们?

谢谢

4

0 回答 0