[英]404 Not Found (Source not found on the server) Slim Framework
I am willing to get a json response whether an administrator is registered or not. 无论管理员是否注册,我都愿意得到json响应。 So I made this get function with these parameters shown below:
因此,我使用以下所示的参数使此get函数起作用:
$app->get('/admin/:email/:password', function($email, $password){
$password = md5($password);
$databaseObject = new DatabaseLayer();
$isRegistered = $databaseObject->isAdminExist($email, $password);
$app = \Slim\Slim::getInstance();
if ($isRegistered){
$app->response->setStatus('200');
$app->response->headers->set('Content_Type', 'application/json');
echo json_encode(Array('isLogin' => '1'));
} else {
echo json_encode(Array('isLogin' => '0'));
}
});
My problem is when I add a point to the email parameter, it doesn't work. 我的问题是,当我在email参数中添加一个点时,它不起作用。 Here is a screenshot with no point in the email param:
这是电子邮件参数中没有任何意义的屏幕截图:
Here is a second screenshot with a point in the email param: 这是第二张屏幕截图,其中电子邮件参数中有一个要点:
Please can I get some help, this is for a project I am making. 请给我一些帮助,这是针对我正在做的项目。 Thank you.
谢谢。
For more further information, I am using Slim version 2.* 有关更多信息,我正在使用Slim版本2. *
您的路线应如下所示:
$app->get('/admin/{email}/{password}', function($email, $password){
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.