PHP: Includes Tutorial

pulse__xx

Member
Messages
350
Reaction score
0
Points
16
PHP includes are an important part of PHP. With HTML sometimes it gets very annoying having to change everything if for example you change your layout, it can be very time consuming ! PHP includes break down this process so that can have a header.php file and a footer.php file and these will appear on every main page, so if you were to change your layout you would only have to change these two files !

1. Here is an example of the HTML page, it is a very simple page to make it easier for you to understand. Basically this coding would be on every individual page but the only bit that would change would be where the content is. So you see how inefficient this is?

<head>
<title>Your page title</title>
<link rel="stylesheet" type="text/css" href="style.css">
</head>

<body>
<div id="content">Main content here</div>

<div id="footer">Copyright</div>
</body>

2. Take the top part of your coding that is always the same with each page

<head>
<title>Your page title</title>
<link rel="stylesheet" type="text/css" href="style.css">
</head>

Now paste this into notepad and save it as header.php

3. Take the bottom part of the coding that is the same with each page.

<div id="footer">Copyright</div>
</body>

Now paste this into notepad and save it as footer.php

4. Now you will be left with the middle part... this should change with each page as this is the actual content. So now we can join this together

<?PHP include ("header.php"); ?>

<body>
<div id="content">Main content here</div>

<?PHP include ("footer.php"); ?>

Now you could name this file content.php, or whatever, but make sure it ends in .php ! and for another page for example tutorials.php you could use the same coding, eg

<?PHP include ("header.php"); ?>

<body>
<div id="content"><b>Tutorials</b>
<br>
List of tutorials here
</div>

<?PHP include ("footer.php"); ?>

The header and footer will be the same, just the content will change, so then if you decide to change your layout, you will only need to edit header.php and footer.php!

Sysque Studios for more tutorials.

This tutorial is brought to you by http://so-you.net/
 
Last edited:

Bryon

I Fix Things
Messages
8,149
Reaction score
101
Points
48
Your infringing on "Char's" copyrights.

Unless you own that site too, or submitted it to them...

Learn how to give people their credit.
 
Last edited:

pulse__xx

Member
Messages
350
Reaction score
0
Points
16
She actually has stolen tutorials from me in the past, this tutorial is not hers and Char has stolen random tutorials from codejunction.com and sekka.co.uk.
 

Bryon

I Fix Things
Messages
8,149
Reaction score
101
Points
48
Hmm. Well still, can you prove that?

Who cares if they stole them, that doesn't give you the right to take credit for them, and say they are yours.

All the tutorials you have just posted in the last little while have been taken off of other sites. It's pretty pathetic.
 
Last edited:

Jake

Developer
Contributors
Messages
4,057
Reaction score
5
Points
0
you know whats always good? using a tutorial to write a better tutorial ;)
 

pulse__xx

Member
Messages
350
Reaction score
0
Points
16
Yes, actually she was copying and pasting tutorials from my beta website 3 days ago.

Using my log script, I have found her IP Address.

Logged 10/7/2005::|||||||||=====__3:45 P.M.@**!
User from ip ||65.43.22.191|| viewing //('tutorial')// section.
User from ip ||65.43.22.191|| viewing //('tutorial')// section.
User from ip ||65.43.22.191|| viewing //('tutorial')// section.
User from ip ||65.43.22.191|| copying code //('tutorial')// section.
User from ip ||65.43.22.191|| copying code //('tutorial')// section.
User from ip ||65.43.22.191|| copying code //('tutorial')// section.
User from ip ||65.43.22.191|| copying code //('tutorial')// section.
User from ip ||21.72.110.63|| viewing //('tutorial')// section.
User from ip ||21.72.110.63|| viewing //('tutorial')// section.
User from ip ||21.72.110.63|| left //('tutorial')// section.
User from ip ||21.72.110.63|| left //('tutorial')// section.
User from ip ||65.43.22.191|| left //('tutorial')// section.
==
Logged.
 

Bryon

I Fix Things
Messages
8,149
Reaction score
101
Points
48
How could a PHP logging script "know" when a tutorial is being "copied and pasted"? I think you just made that up. (You did by the way)

Bull ****. She did not steal the tutorials from you on 10/7. I have solid proof of this also.

Stop lieing, or I myself will just delete these threads and warn you, even if it's not my place to do so.

*scowls*
 
Last edited:

Mani5

New Member
Messages
946
Reaction score
0
Points
0
yo! dude chill take some rest and please stop posting these tutorial in x10..I go an idea why dont u make a forum put all these tut there and give us da link to that site...

thats what I sya and well NedreN is quite right..
 

XUnreal

New Member
Messages
370
Reaction score
0
Points
0
pulse__xx said:
Yes, actually she was copying and pasting tutorials from my beta website 3 days ago.

Using my log script, I have found her IP Address.

Logged 10/7/2005::|||||||||=====__3:45 P.M.@**!
User from ip ||65.43.22.191|| viewing //('tutorial')// section.
User from ip ||65.43.22.191|| viewing //('tutorial')// section.
User from ip ||65.43.22.191|| viewing //('tutorial')// section.
User from ip ||65.43.22.191|| copying code //('tutorial')// section.
User from ip ||65.43.22.191|| copying code //('tutorial')// section.
User from ip ||65.43.22.191|| copying code //('tutorial')// section.
User from ip ||65.43.22.191|| copying code //('tutorial')// section.
User from ip ||21.72.110.63|| viewing //('tutorial')// section.
User from ip ||21.72.110.63|| viewing //('tutorial')// section.
User from ip ||21.72.110.63|| left //('tutorial')// section.
User from ip ||21.72.110.63|| left //('tutorial')// section.
User from ip ||65.43.22.191|| left //('tutorial')// section.
==
Logged.

LMAO!! I think I know PHP more than you and whoever made that is a genius.
Who made it? Please send it to me :)

:sarcastic:
 
Last edited:

Mani5

New Member
Messages
946
Reaction score
0
Points
0
soo pulse r u gonna make a forum with all the tutorials and give us da link to it?
 

disturbedart

Member
Messages
474
Reaction score
1
Points
18
pure genius but really funny this php script was made so badly, at least he could of put it in script form lmao.
Too easy that and was caught out.
Also to many people know php here to be fooled by a pathetic little notepad.exe job done by some l33t php maker.
i want a copy of that script tho ill try it on php-nuke forums haha see if they notice.
 
Last edited:

[XiRE]

New Member
Messages
44
Reaction score
0
Points
0
disturbedart said:
pure genius but really funny this php script was made so badly at least he could of put it in script form lmao hehe to easy that and was caught out and to many people know php here to be fooled by a pathetic little notepad.exe job done by some l33t php maker HEHE funny i want a copy of that script tho ill try it on php-nuke forums haha see if they notice.
That made no. sense at all. Try some PUNCTUATION please. :nuts:
 
Top