Home > Backend Development > PHP Tutorial > Slim Get带参数404错误

Slim Get带参数404错误

不言
Release: 2023-02-28 12:02:02
Original
1060 people have browsed it


接口实现:

$app->get('/hello/:name/', function ($name) {
    echo "Hello, $name";
});
Copy after login
Copy after login

get-url:http://localhost/prj/index.php/hello?name=myname
测试结果:404 Not Found

回复内容:

接口实现:

$app->get('/hello/:name/', function ($name) {
    echo "Hello, $name";
});
Copy after login
Copy after login

get-url:http://localhost/prj/index.php/hello?name=myname
测试结果:404 Not Found 

路由直接http://localhost/prj/index.php/hello/myname就可以吧

Related labels:
php
source:php.cn
Statement of this Website
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn
Popular Tutorials
More>
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template