我有这样的站点树
controller(文件夹)文件 1.php 文件
2.php
.....
文件 10.phpview(文件夹)home.php
profile.php
message.php
login.php
register.php
.....index.phpcss.cssjs.js
目前index.php很常见,它首先包含用户想要的页面,
www.mysite.com/?show=profile
我正在验证变量show并在我的index.php
索引.php
$show=$_GET['show'].".php";
include("view/".$show);
但我不希望我的 URL 像这样www.mysite.com/?show=profile,我希望如果用户john点击页面,profile那么我的 URL 应该是
www.mysite.com/john/profile/
john我知道它说:然后转到文件夹profile,最后index.php
我是否必须为每个用户制作每个文件夹和文件,或者有什么方法可以使用当前的站点树来完成它?
我希望你明白我想说什么:(
谢谢