我收到以下内部服务器错误:
它没有在我的 PHP 错误日志中打印任何内容?
不使用任何框架。
我有以下文档结构
DEV
- controllers
|-> user
-> check_email.php
- public_html
|-> routes
|-> user
-> check_email.php
|-> views
|-> user
-> create.php
base_url 设置为我的域名(public_html)。
set_include_path 设置为我的文档结构(DEV)
public_html/views/user/create.php
xmlhttp.open("POST","/routes/user/check_email.php",true);
public_html/routes/user/check_email.php
require_once(get_include_path()."/controllers/user/check_email.php");
如果我将 check_email.php 的 Controller 放在与 create.php 相同的文件夹中(并修改 XMLhttp 请求),那么它会引用该 Controller 。如何将 POST 路由到 Controller ?
最佳答案
这就是你说的吗?
- POST 数据正在发送至
/routes/user/check_email.php
/routes/user/check_email.php
需要/controllers/user/check_email.php
- 您想要从 Controller 访问 POST 数据。
这可能不是您所说的,因为如果是这样,答案似乎太简单了(所需的文件可以访问 $_POST 超全局)。
编辑以反射(reflect)已编辑的问题:要诊断 500 个内部服务器错误,请按照:https://stackoverflow.com/a/20511956/897059
关于javascript - 如何使用 PHP 处理 Controller 的 XMLhttp 请求,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/36919093/