View Full Version : one php file multiple pages??
nathanp
02-19-2007, 10:45 PM
Hi I'm new to PHP and am still learning some of the language; so what I'm about to ask may have a really obvious answer but could you bear with me. I was wondering if it is possible to have one PHP file with multiple html pages stored into it? So that multiple web page can be combined in one place and run.
Thanks for any help on the subject
Yes.
There are alot of pro's and con's to having all the code in one file.
you can use a simple $_GET variable like pageID
the user end would see it as http://yoursite.com/index.php?pageID=2
in the php code
<?php
if ($_GET['pageID'] == '2')
{
//display page 2
}
else if($_GET['pageID'] == '1')
{
//display page 1
}
I'd prefer having a separate html file the php code calls and parses to place in dynamic content. Templates are good...
nathanp
02-20-2007, 07:18 PM
Thank you for your help.
Yes I will start using template as well, it's just I wanted to create a setup file that would run all the setup processes and then could be deleted by the user afterwards. Instead of having multiple files to delete after setup.
Again, Many Thanks
Nathan
vBulletin® v3.8.2, Copyright ©2000-2012, Jelsoft Enterprises Ltd.