FRIHOST FORUMS SEARCH FAQ TOS BLOGS COMPETITIONS
You are invited to Log in or Register a free Frihost Account!


Putting something on every page...





Dark_Jedi06
Is it possible to place something on one page, and then have it appear on every other page? For example, if I wanted a picture on every single page on my site in the same exact sopt, would it be possible without having to go through and edit all my pages?
phydea
Hi,

Yes you can make that. You must create a PHP page. Take your photo on a php file (with HTML codes) and change your extention to .php. And now, make a Include to your pages how you will to affect this picture, to do that you must in your page where you will so your images was shows type that :
<? include ("youfileinphp.php"); ?>.

So you can edit this file content your images and in all the pages how you have take this PHp code will be affect.

Bye.

=> I'm french, i speak not english very well :$ sorry...
Dark_Jedi06
I'm confused by that...>_>

Sorry. Sad
MicrosoftMan
Dark_Jedi06 wrote:
...would it be possible without having to go through and edit all my pages?
Ya. If you are using a webdesign program, such as Dreamweaver, use a Template. With a template you make changes to one page (the template) and it will make the alterations on all the corresponding pages made from that template. Simple as that. Without using a template of some sort the web designer [you] would have to create every single individual page and link them together and so on. So skip that hassle and use a template. If you need more info this is a forum you know. Very Happy
Dark_Jedi06
MicrosoftMan wrote:
Dark_Jedi06 wrote:
...would it be possible without having to go through and edit all my pages?
Ya. If you are using a webdesign program, such as Dreamweaver, use a Template. With a template you make changes to one page (the template) and it will make the alterations on all the corresponding pages made from that template. Simple as that. Without using a template of some sort the web designer [you] would have to create every single individual page and link them together and so on. So skip that hassle and use a template. If you need more info this is a forum you know. Very Happy
I'm not using any webdesign program...though I could be using Dreamweaver.

I use the HTML editor with cPanel and Notepad...probably a bad idea. Can you point me to any Dreamweaver tutorials?
m_furquan36
I had a similar problem, and all i kew was front page! Embarassed

But i solved it trhough Inline frames. You see my template, i.e (Images, background, lines etc etc) were on the main page, Including the menu contents, and the menu contents pages used to change within an inline frame of the main webpage, meaning the content page changed without the whole site reloading all over again. Bu ne ways, for you id suggest Dreamweaver, or u cud even give this a try! Wink
m_furquan36
I edited and replaced this message with sumthing else, cuz i accidentally double posted, plz no affence Mr Moderator! My connection was too laggy to i double clicked the submit button! Crying or Very sad
bluetenshi
I'll make it as simple as possible ^.^

Assuming that you want to create a header that would go in all of your pages. Let's also assume that this is what you want your header's code to be:

Code:
<html>
<head><title>Common Title</title></head>
<body>
<h1>Common Title</h1>
<img src="header.jpg" alt="Header Picture" />


In order to make this code appear in all of your pages without using the copy-paste method, you could create a header file containing the header code and include them in all of your pages. Confused? Let me make it more clear.

First, create a file using notepad where you will put your header codes in. Save as filename.php. Note the php extension. For our sample's sake...

header.php <- the filename I want

Code:
<html>
<head><title>Common Title</title></head>
<body>
<h1>Common Title</h1>
<img src="header.jpg" alt="Header Picture" />


Now we will edit the files you want to place the header in. For example, you want to place the header in index.html. Before you could include the file, you must first change its extension into .php and remove the starting html tags. Going back to our example...

index.html
Code:
<html>
<head>
<title></title>
</head>
<body>
...
code
...
</body>
</html>


index.php
Code:
<?php include("header.php") ?>
...
code
...
</body>
</html>


What the hell does <?php include("header.php") ?> mean?!
Well it means that you want to include the file header.php in index.php. Now when the server reads your php files it will display it in our browsers as...

Code:
<html>
<head><title>Common Title</title></head>
<body>
<h1>Common Title</h1>
<img src="header.jpg" alt="Header Picture" />
...
code
...
</body>
</html>


I hope that this helps. ^.^

Here is what your directory will look like...

Before
Code:

.
..
index.html
gallery.html


After
Code:

.
..
index.php
header.php
gallery.php
Dark_Jedi06
Sorry...I'm still confused. Sad

Where do I upload the php file to? And how exactly do I get it to show on a page...>_>
bluetenshi
I think I made is as clear as I could. Please read it thoroughly... Perform the instructions step by step. I edited my past post to show the directory structure before and after the steps are executed.
bnbrown
How many pages do you have? I mean you can make the simple and easy ctrl+c --> ctrl+v method, that costs nothing.

Also if you want, I think, you can use an external Style Sheet (CSS) for every page. If you know what on earth is that I will send a HowTo.
SamiTheBerber
Dark_Jedi06 wrote:
Sorry...I'm still confused. Sad

Where do I upload the php file to? And how exactly do I get it to show on a page...>_>

You upload php's like normal html with your FTP-program. I'm not sure if you can save php's in online editor Confused
52tease
Thank you for that very concise explaination. I've just started playing with PHP a little bit for my site and didn't understand much of what I was doing, but you've just provided my first, comprehensible, php lesson.

It is very easy and well explained.
bluetenshi
Thanks too. Feels good to know you've help someone ^.^ BTW, if you have more questions regarding PHP, I would be happy to help. What I've written was just about the include function. There's alot more to learn so if you have any problem in understanding PHP, you could always ask me =)
eday2010
PHP is something I have started learning since I started working with a website that uses PHP. It makes it much easier to make changes and updates. If you know C or C++ or Turbo Pascal, PHP should be easy to learn. Sadly, I'm not very familiar with C++, or Turbo Pascal anymore.

bluetenshi, are you familiar with MySQL? Once I finish my sie, I wanted to make a back-end editor to update it easily by just filling in fields an having it post it up.
bogden
i just redid my frames site w/ php includes
it works fine
picsite
ya use a template....are u using dreamweaver?
Related topics
Snow fall on website
[CSS] Height property in Internet Explorer
php SESSIONS question
Awstats for DirectAdmin
Why are you using FRIhost
Meta Description
Unique joomla page titles?
Flash or HTML
Page Counters *oppen*
need IP blocker on my site
Website Logo...
Need some tips
<?php session_start(); ?> on Every Page
Site load in half time (with no browser compatibility issue)
Reply to topic    Frihost Forum Index -> Webmaster and Internet -> Design Tips

FRIHOST HOME | FAQ | TOS | ABOUT US | CONTACT US | SITE MAP
© 2005-2011 Frihost, forums powered by phpBB.