chong Posted December 15, 2006 Share Posted December 15, 2006 Afternoon all, Im fairly new to PHP and I have started to experiment with some code in order to get php to include my pages into the body(for instance index.php?=news etc) i have written a simple part of my code below, however i am a little stuck...i need to add the .php to the $page variable however im lost - im positive ive gone hugely wrong and missing something!any help would be much appreciated!<?php include('header.inc'); ?><?php $page = $_GET['url']; if !$page{ $body_inc = 404_notfoud } $body_inc = $page; include($body_inc); ?><?php include('footer'); ?> Link to comment https://forums.phpfreaks.com/topic/30753-body-includes-using-get-url/ Share on other sites More sharing options...
taith Posted December 15, 2006 Share Posted December 15, 2006 [code]<?phpinclude('header.inc');$page = $_GET['url'];if(empty($page)) $page = 404_notfoudinclude($page.'.php'); include('footer');?>[/code] Link to comment https://forums.phpfreaks.com/topic/30753-body-includes-using-get-url/#findComment-141741 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.