|
|||
|
|
|||
Menu- Help Forum - CIA Topsite - Getting Started - HTML Tags - Links - Graphics - Text - Display Your Code - Site Formatting - CSS - PHP - What is PHP? - Why Use PHP? - How to Use PHP - Javascript - Guestbooks / Shoutbox - Lists - Extras - Site Tips Tools- Scrollbar Gen - ASCII Chart - HTML Cheat Sheet - MySpace Ad Remover - Xanga Ad Remover Contact MeSite Links- Your link here - More Affiliates... |
PHPWhat is PHP?PHP is a different form of HTML in which code is read and compiled as the visitor arrives at the page.Top Why use PHP?PHP, like CSS allows you to change multiple areas in a relatively easy way. This page for example utilizes php include statements which tell the page to go and gather information from other pages on the server.Top How do I use PHP?Well first things first, you must be certain that php is enabled on the server you purchased. If you need assistance checking for this contact the support of your server provider.<?php include("includes/Footer.php"); ?>
This is a code copied directly from part of my site. Unfortunately you would be unable to find it because that changes into the code that is on the Footer.php file. This include statement appears on every page of this website and produces the same footer on every page. The cool thing about using this is that now if I needed to add something to the footer of every page I could simply change Footer.php and all of them would change instantly. Pretty cool hu? Top Making your own ExampleI apologize for the lack of example here but it's extremely difficult to show the example. You will just have to try it out yourself. Just open your HTML editor and create a page with some text, any text doesn't even need to be code. Upload that to your server call it example.php then create main.php and place the code<?php include("example.php"); ?> If you place both example.php and main.php in the same folder on your server and you visit main.php and attempt to view source (right click the page go to view source). You will notice the code on the page is just the text you placed in example.php. You won't see the include code at all. That's how it works. Top |
||
![]() |
|||