472,354 Members | 2,133 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 472,354 software developers and data experts.

Best way to update website

114 100+
Hi Friends,

I have two HTML websites and I am regularly making lots of changes in one of them. Now I want the 2nd website should be updated automatically so that I don't need to update the website twice.

Here are two websites:




The only difference in both websites is the header and footer. Rest everything is the same.

I want that when I make any changes in example.com, it should automatically updated in php.net but I need to keep header and footer different for both the websites. The rest of the content should be the same for both websites.

Please help me on this and advise how can I do this?


Feb 20 '09 #1
5 3719
1,168 Expert 1GB
Well you could just have two footer/header files and store them each in their own website folder and basically just have all your content in one file (and your headers/footers in separate ones) and then include all the files like this:
For webiste 1:
Expand|Select|Wrap|Line Numbers
  1. include( 'header.php');
  2. include( 'content.php');
  3. include( 'footer.php');
For webiste 2:
Expand|Select|Wrap|Line Numbers
  1. include( 'header.php');
  2. include( '../website_1/content.php');
  3. include( 'footer.php');
This is assuming your websites are on the same server and in the same folder (eg public_html). So each website calls the header.php and footer.php in it's own directory, but both websites call the content of website 1. I hope that made sense.
Feb 20 '09 #2
8,658 Expert Mod 8TB
if you have both domains on different servers you may as well use an ftp client that is able to sync folders. though it's not done automaticly it's just 2 or 3 clicks.
Feb 20 '09 #3
You can use iFrames :)
Mar 1 '09 #4
6,050 Expert 4TB
Or, I'm just throwing it out there, you could try using a database and take the pain of having to edit files directly away? That makes the most sense.

Expand|Select|Wrap|Line Numbers
  1. $page->get_header();
  3. $page->get_content();
  5. $page->get_footer();
$page->get_content would make a request to your database (perhaps through a model) for the content, preparing it for display.
Mar 1 '09 #5
6,050 Expert 4TB
iframes are bad. Go the server route.
Mar 1 '09 #6

Sign in to post your reply or Sign up for a free account.

Similar topics

by: laurie | last post by:
Hi all, I'm trying to help out a friend who has inherited a client with a PHP shopping cart application. Neither of us know PHP, but I've been muddling my way through, trying to get these old...
by: Jaunty Edward | last post by:
HI, I have to write secure update record php script, here are the complete details of the website, the website has a login system that authenticates the user, writes the session ID for username...
by: revolnip | last post by:
As attached is the code : <% Option Explicit dim lngTimer lngTimer = Timer %> <!--#include file="Connect.asp" --> <!--#include file="Settings.asp" --> <!--#include file="Common.asp" -->
by: S.Sigal | last post by:
Hello: Always wanted to do this -- but never knew how... The goal is to write software that goes out to clients -- but I want to be able to auto-update them when there is a later release...
by: Stephen Brown | last post by:
We've been using dotNet for a couple of years now and have been updating our live server by just overwriting (Explorer drag and drop) the aspx and assembly files until we had some errors reported...
by: Rudy | last post by:
Hello! I currently have a site online. I added more features to my datagrid page, so users can update and stuff. I though I could just copy the aspx, aspx.vb and the server page including the...
by: Jeff Gardner | last post by:
Greetings: I have an UPDATE query (php 5.1.6/mysql 5.0.24a on apache 2.2) that appears to execute with no errors (php,mysql, or apache) but the data in the "UPDATED" table doesn't change. I've...
by: dougmeece | last post by:
Morning Everyone... I have a table that needs to be append to and also updated. All the fields in the table are populated with data from the text boxes and combo boxes on a form. The Date...
by: Faybe1989 | last post by:
Heya, Im looking for a new free website provder and host as I currently have a Lycos Tripod website and as Lycos are closing all there accounts I need a new one. My website is only a litle fan...
by: Kemmylinns12 | last post by:
Blockchain technology has emerged as a transformative force in the business world, offering unprecedented opportunities for innovation and efficiency. While initially associated with cryptocurrencies...
by: Naresh1 | last post by:
What is WebLogic Admin Training? WebLogic Admin Training is a specialized program designed to equip individuals with the skills and knowledge required to effectively administer and manage Oracle...
by: antdb | last post by:
Ⅰ. Advantage of AntDB: hyper-convergence + streaming processing engine In the overall architecture, a new "hyper-convergence" concept was proposed, which integrated multiple engines and...
by: WisdomUfot | last post by:
It's an interesting question you've got about how Gmail hides the HTTP referrer when a link in an email is clicked. While I don't have the specific technical details, Gmail likely implements measures...
by: Matthew3360 | last post by:
Hi, I have been trying to connect to a local host using php curl. But I am finding it hard to do this. I am doing the curl get request from my web server and have made sure to enable curl. I get a...
by: Oralloy | last post by:
Hello Folks, I am trying to hook up a CPU which I designed using SystemC to I/O pins on an FPGA. My problem (spelled failure) is with the synthesis of my design into a bitstream, not the C++...
by: Carina712 | last post by:
Setting background colors for Excel documents can help to improve the visual appeal of the document and make it easier to read and understand. Background colors can be used to highlight important...
by: BLUEPANDA | last post by:
At BluePanda Dev, we're passionate about building high-quality software and sharing our knowledge with the community. That's why we've created a SaaS starter kit that's not only easy to use but also...
by: Rahul1995seven | last post by:
Introduction: In the realm of programming languages, Python has emerged as a powerhouse. With its simplicity, versatility, and robustness, Python has gained popularity among beginners and experts...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.