如果您的应用程序需要根据post类型的请求做出反应,请使用以下命令: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 // ...}它是特定于实现的,但是您将同时使用+ $ _FILES超全局变量。