i trying use url variable trigger page included "include" in php. easy in coldfusion simple line, how can done without bunch of if statements?
<a href="index.php?pageid=products" >products</a> include('/inc'.$_get['pageid']).'.php');
this may shortest code question:
to make thing easier create file named: inc.404.php handle errors
<?php $page = (array_key_exists('page', $_get) ? $_get['page'] : '404');//we're sure inc.404.php there $filename = 'inc.' . $page . '.php'; if(is_file($filename) === false){ $filename = 'inc.404.php'; } include $filename; ?> but using php frameworks symfony make world better place
Comments
Post a Comment