Tycoon Talk
Become a Big fish!
The number 1 forum for online business!
Post topics, ask questions, share your knowledge.
Tycoon Talk is part of Freelancer.com - find skilled workers online at a fraction of the cost.

Coding Forum


You are currently viewing our Coding Forum as a guest. Please register to participate.
Login



Reply
How can i input once to update every page?
Old 11-28-2008, 05:10 AM How can i input once to update every page?
Junior Talker

Posts: 3
Trades: 0
Hey,

I apologize in advance if i am writing this in the wrong section.

I'm putting a webpage together and i'm wanting to have a 'Latest Posts' section which displays around five of the most recent updates to the site. I have looked into setting this up as an RSS feed but i'm not familiar enough with PHP to implement it properly.

So I'm happy to write into the 'Latest Posts' section the title and date of the latest update. But I'm wondering if there is a way i can just type it into the index page (or any other page) and for that to automatically update on every other page where the 'Latest Posts' section is displayed?

Thanks for any replies.
reekdog is offline
Reply With Quote
View Public Profile
 
 
Register now for full access!
Old 11-28-2008, 05:19 AM Re: How can i input once to update every page?
chrishirst's Avatar
Missing! presumed drunk.

Posts: 41,517
Name: Chris Hirst
Location: Blackpool. UK
Trades: 0
Use server side includes

http://www.candsdesign.co.uk/article.../php-includes/
__________________
Chris. ->> Links are advertising NOT optimising!! <<-
A foolish consistency is the hobgoblin of little minds
Thought for today:- I SEO the only industry where all the cowboys are Indians?
chrishirst is online now
Reply With Quote
View Public Profile Visit chrishirst's homepage!
 
Old 11-28-2008, 06:12 PM Re: How can i input once to update every page?
Junior Talker

Posts: 3
Trades: 0
That's great thanks for the link

I'm really new to PHP and was wondering if you wouldn't mind explaining a bit more to implement this and how it will work exactly.

So with the code from the page, if i set this up will i end up with one page which isn't part of my webpage (ie 'latestposts.php') which when i update will automatically make those changes on every other page on my site which is calling the action?

Or, can i have the initial code on my index.php page and when updating that, will make the updated changes automatically on the other pages?


Also, when inserting this code that's shown at the bottom of the link, i see it's calling 'header.php, content.php' etc. Do i need this if all i want to do is update the latest posts section? Actually i would like to use this code to update a 'Links' section as well. So can i implement both the Latest Posts and Links in the one code and if so, how do i change it up so it does so?

<? include( $domain . "/include/header.php");?>
<? breadcrumbs();?>
<? include("content.php");?>
<? include($domain . "/include/footer.php");?


Appreciate any help, thanks
reekdog is offline
Reply With Quote
View Public Profile
 
Old 11-28-2008, 08:33 PM Re: How can i input once to update every page?
chrishirst's Avatar
Missing! presumed drunk.

Posts: 41,517
Name: Chris Hirst
Location: Blackpool. UK
Trades: 0
Quote:
f i set this up will i end up with one page which isn't part of my webpage (ie 'latestposts.php') which when i update will automatically make those changes on every other page on my site which is calling the action?
An included page becomes part of the page it is included into.
Just simply have a script that gets the latest posts and prints it to the page it is included, in at the position that it is included.

Quote:
Also, when inserting this code that's shown at the bottom of the link, i see it's calling 'header.php, content.php' etc. Do i need this if all i want to do is update the latest posts section? Actually i would like to use this code to update a 'Links' section as well. So can i implement both the Latest Posts and Links in the one code and if so, how do i change it up so it does so?
Not if you don't want to, it's just simpler to have the parts of pages that are all the same in a single file and include them, so if you decide to change a logo, it's only one edit, and every page changes at once.
__________________
Chris. ->> Links are advertising NOT optimising!! <<-
A foolish consistency is the hobgoblin of little minds
Thought for today:- I SEO the only industry where all the cowboys are Indians?
chrishirst is online now
Reply With Quote
View Public Profile Visit chrishirst's homepage!
 
Old 11-29-2008, 12:51 AM Re: How can i input once to update every page?
Junior Talker

Posts: 3
Trades: 0
Thanks again for the reply.

So.. in other words, the same PHP code will be placed on every page i have 'Latest posts' showing. And if i update the latest posts on ANY of the pages, it will automatically change on the rest? Or have i got that wrong and i need a main PHP page which i alter in order for the automatic changes to be made throughout all pages?

With the code, is it almost like CSS but for text?
So on every page i will need to refer to only the places which i want to change, i.e if i want to change the header image i can do that in CSS, so i don't need to refer to it within the PHP code I'm putting together for 'Latest Posts' ?

If i was then to change the following code:

<? include( $domain . "/include/header.php");?>
<? breadcrumbs();?>
<? include("content.php");?>
<? include($domain . "/include/footer.php");?


How do i change this so it is reading the 'latest posts' which isn't a page of it's own, it's just a part of the page. I'm not sure how to call it when it's not something like latestposts.php.

Thanks again for your help.
reekdog is offline
Reply With Quote
View Public Profile
 
Reply     « Reply to How can i input once to update every page?
 

Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are Off
Pingbacks are Off
Refbacks are Off





   
RSS Feed  Feeds: RSS   JS   XML
RSS Feed  Feeds for this forum: RSS   JS   XML



Page generated in 0.18824 seconds with 12 queries