Search
Left Quote    By failing to prepare, you are preparing to fail.
- Benjamin Franklin    
Right Quote
 
[login] | [Register]
 

One File Website

by: Parasite
Page: 1 of 1
(View All)

Introduction

This will be for the smaller websites, for the larger ones you can always include, this is still a great tutorial. It's quite simple really, PHP has a nice variable array called $_GET, You can set a variable to be equal to this, to use in if statements, like this:



This is the other page Go home

This basically does what it looks like, you click the go home link and you get taken back to the news page. You can also do something like this, if you want a header and footer (all these files can be included instead of all on one page, if you want)



This is the content of the news

So there it is, very simple, short, and satisfying tutorial on how to build an entire website with one file.

Keep in mind, you can keep adding elseif statements if you want, but also remember, the more content on one file, the longer the loading time... It may be a good idea for larger sites to include their files in the if and elseif statements.. and to require a file for the header and footer. If you want a different title per page, just use a variable and teh same get array, if the page is equal to whatever, then the variable $title = whatever... Get it?


If not just e-mail me... :)

1  |  


No Comments for this page.

You Must be logged in or a member to comment.


Tutorial Stats

Tutorial Stats

18,071 Views
0 Total Comments
4.5 Rating of 5 (2 Votes)

Options

Tutorial Options

· Login to Rate This Article
· Login to Post a Comment
· Read more by this author
Digg This Article! Del.icio.us: Bookmark This Article Reddit: Bookmark This Article BlinkList: Blink This Article! YahooMyWeb BlogMarks: Add This Mark! Furl: Save This Article Spurl: Mark This Article

Articles

Related    

· Simple PHP Tutorial
· Pagination with PHP
· Building a Comments Script
· Complete Members System
· Variable Scope



"AllSyntax.com" Copyright © 2002-2017; All rights lefted, all lefts righted.
Privacy Policy  |  Internet Rank