我在做一个简单的复习申请。下图是我的数据库架构:
下面是我用来接受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();
}
}
我正在使用邮递员发送邮寄请求: