3
Contributors
5
Replies
6
Views
5 Years
Discussion Span
Last Post by Biiim
0
index.php

<?php
if($_GET['id'] == 1){
echo 'page 1';
}elseif($_GET['id'] == 5){
echo 'contact page';
}else{
echo 'page 2';
}
?>

---------------------------------
index.php?id=1 -> page 1
index.php -> page 2
index.php?id=5 -> contact page

0

That was an example, its generally backed by a database and each page is generated by putting data from it in a template. you could do like above but it is probably easier just making new pages as it will get quite bloated.

includes may help keep the file small

index.php
 
<?php
if($_GET['id'] == 1){
require_once 'aboutus.html';
}elseif($_GET['id'] == 5){
require_once 'contact';
}else{
require_once 'home.html';
}
?>

if you have a mysql database/server available look at learning how to make use of that to make best use of dynamic pages

http://www.freewebmasterhelp.com/tutorials/phpmysql

This topic has been dead for over six months. Start a new discussion instead.
Have something to contribute to this discussion? Please be thoughtful, detailed and courteous, and be sure to adhere to our posting rules.