How do I add content using .php coding?
March 3rd, 2010 by admin
I have ran a website before, but took a while off and completely forgot what to do!
I got my web layout coded, and have the index page up, but I completely forgot about header pages, and how to add content without having to enter in all the info for the layout.
Any links to websites would be helpful!
The keyterm "echo" will print out html code.
- 2 Comments »
- Posted in PHP Coding

The keyterm "echo" will print out html code.
References :
What I think you’re talking about is called, Indexing.
Indexing being, when you "watch" a certain variable for when the page loads to decide what kind of content you would place on the page.
An example in PHP would be:
<?php
$mylink = $_GET['link'];
if( isset( $mylink ) )
{
switch( $mylink )
{
case "page1":
require( "body_page1.php" );
break;
default:
require( "body_mainpage.php" );
}
}
else
{
require( "body_mainpage.php" );
}
?>
and of course to include the body_page1.php into the page your link would look like: http://www.yoursite.com/index.php?link=page1
If you need more info on Indexing feel free to E-mail me at
hex@xpence.net and I can give you examples or write a
small indexing script for you.
Words of Wisdom,
– Hex
References :