if(strtoupper($_SERVER['REQUEST_METHOD']) === 'POST') { // if form submitted with post method
// validate request,
// manage post request differently,
// log or don't log request,
// redirect to avoid resubmition on F5 etc
}
如果你的应用程序需要对通过邮寄请求收到的任何数据作出反应,请使用以下方法:
if(!empty($_POST)) { // if received any post data
// process $_POST values,
// save data to DB,
// ...
}
if(!empty($_FILES)) { // if received any "post" files
// validate uploaded FILES
// move to uploaded dir
// ...
}