php - Call from template with $_GET -
so i'm trying make own template site it's easy use , i'm trying figure out how include different paths.
currently have below nested inside of body navbar.php
<? include 'content.php' ?>
what i've tried is
<? $_get["path"]; include "$_get" . ".php"; ?>
i want change out content.php have less static pages. assume above isn't safe. alternative this?
if want make more secure, can use array checking includes pages:
<?php $validpages = array('content', 'home', ...); if(in_array($_get['path'], $validpages)) { include($_get['path'].".php"); } ?>
Comments
Post a Comment