【发布时间】:2011-09-20 07:43:08
【问题描述】:
如果我想做这样的事情,最好的方法是什么;
我称之为页面调用。
我有一个 index.php,它将运行 config.php
我想以 index.php 作为我的核心然后做类似的事情
index.php?customer=home or index.php?customer=viewaccount
index.php?admin=home or index.php?admin=updateproduct
然后调用特定的 php 文件,例如。 home.php , viewaccount.php
最好的问候 非常感谢您的帮助。=)
【问题讨论】:
-
嗯.. 这已经过时了。现在你使用类似'/customer/viewaccount'的东西。如果这对您来说是个问题,您最好检查 MVC 框架。
-
您的意思是通过 GET 变量重定向吗?我不太明白您要达到的目标。代码 sn-ps 真的取决于你想要实现的目标。您必须提供更多关于您实际想要做什么的数据。
-
PHP Frontcontroller 的可能重复项
-
@yi_H 大多数框架都执行 OP 在后台描述的内容。是 mod_rewrite 使 URL 变得“漂亮”。