我看到一些网站(例如):如果你想查看你的消息框,那么它是:example.com/file.php?action=pm
如果你想再次发送消息,地址和文件是相同的,但$_GET
不同:example.com/file.php?action=sendpm
它是如何工作的?
仅仅是:
if ($_GET['action'] == "pm")
{
//lots of html code(divs, forms, etc) paste here for action=pm.
}
else
{
//lots of html code paste here for action=send
}
而不是有文件:pm.php,send.php ...?或者机制不同?
我看到 SMF 使用这种机制,我也看到了 facebook.com/?ref=something 的类似内容。
它是如何工作的?