I have different mods such as users, statistics and etc. If I click over users I get information about users, if I click statistics I get user statistics and so on. But I want to do that automatically with php (not OOP) - auto include and call files (for example users.php, statistics.php and others) from mods folder. I know php OOP has autoload class function. But I don't know PHP Object Oriented. How can I do that with PHP without OOP? I want links to be like that:
<a href='index.php?mod=users'>User list</a> <a href='index.php?mod=statistics'>Statistics</a>
if (isset($_GET["mod"]) && file_exists("mods/" . preg_replace("/[^\w\d]+/", "", $_GET["mod"]) . ".php")) {
include "mods/" . preg_replace("/[^\w\d]+/", "", $_GET["mod"]) . ".php"; // or: require("mods/" . preg_replace("/[^\w\d]+/", "", $_GET["mod"]) . ".php");
}