处理单个php文件中的get和post请求 [英] handling get and post request in single php file

查看:67
本文介绍了处理单个php文件中的get和post请求的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

使用单个php文件如何处理同一文件上的获取和发布请求



目前我尝试了什么



using a single php file how to handle get and post request on same file

currently what i have tried

if (isset($_GET["action"])){
//logic goes here
}
if (isset($_POST["action"]) && !empty($_POST["action"])) {
//logic goes here
}



使用不同的操作方法名称处理不同的get和post请求的标准方法??我在客户端使用角度。 PHP中的初学者我是


standard way to handle different get and post request with different action method name?? I am using angular at client side. Beginner in PHP I am

推荐答案

_GET [ action ])){
// 逻辑在这里
}
if (isset(
_GET["action"])){ //logic goes here } if (isset(


_POST [ action])&&!empty(
_POST["action"]) && !empty(


_POST [ action])){
// 逻辑到这里
}
_POST["action"])) { //logic goes here }



用不同的动作方法名称处理不同的get和post请求的标准方法??我在客户端使用角度。 PHP初学者我是


standard way to handle different get and post request with different action method name?? I am using angular at client side. Beginner in PHP I am


这篇关于处理单个php文件中的get和post请求的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆