如何处理对具有 PHP 的控制器的 XMLhttp 请求


How to handle an XMLhttp request to a controller wih PHP

我收到以下内部服务器错误:
它没有在我的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/视图/用户/创建.php

xmlhttp.open("POST","/routes/user/check_email.php",true);

public_html/路由/用户/check_email.php

require_once(get_include_path()."/controllers/user/check_email.php");

如果我将用于check_email.php的控制器放在与 create 相同的文件夹中.php(并修改 XMLhttp 请求),那么它会引用控制器。 如何将开机自检路由到控制器?

这是你在说的吗?

  1. 开机自检数据正在发送到/routes/user/check_email.php
  2. /routes/user/check_email.php需要/controllers/user/check_email.php
  3. 您希望从控制器访问开机自检数据。

这可能不是你所说的,因为如果是,答案似乎太简单了(所需的文件可以访问 $_POST 超全局)。

编辑

以反映编辑的问题:要诊断 500 个内部服务器错误,请遵循:https://stackoverflow.com/a/20511956/897059