How do I update all my web pages at once?

Discussion in 'HTML & Website Design' started by Pixulated, Feb 12, 2009.

  1. #1
    Right I've got a website but I'm after updating all the pages at once.

    Like say putting a new header in.

    This website has like over 5000 pages.

    So how do I go about updating it all at once?

    Can someone please help me!
     
    Pixulated, Feb 12, 2009 IP
  2. Kerosene

    Kerosene Alpha & Omega™ Staff

    Messages:
    11,366
    Likes Received:
    575
    Best Answers:
    4
    Trophy Points:
    385
  3. ClassHelper.org

    ClassHelper.org Guest

    Messages:
    273
    Likes Received:
    14
    Best Answers:
    0
    Trophy Points:
    0
    #3
    If your site is hosted on Linux or BSD, you can easily accomplish this using a simple Perl script (read in files specified by a pattern and perform search and replace operations on the text), or by using the "sed" command in your shell.
     
    ClassHelper.org, Feb 12, 2009 IP
  4. Pixulated

    Pixulated Peon

    Messages:
    71
    Likes Received:
    2
    Best Answers:
    0
    Trophy Points:
    0
    #4
    I really don't understand this, is there like no program that could do it or anything?

    All my pages are just in simple html, I just really don't understand this.
     
    Pixulated, Feb 12, 2009 IP
  5. Kerosene

    Kerosene Alpha & Omega™ Staff

    Messages:
    11,366
    Likes Received:
    575
    Best Answers:
    4
    Trophy Points:
    385
    #5
    Read this information about parsing PHP in html pages:
    http://www.desilva.biz/php/phpinhtml.html

    Or use a text editor that can do a seach and replace on all files in a directory (I personally use Dreamweaver), and add your new header to them all at once. It's not pretty, but it will work.
     
    Kerosene, Feb 12, 2009 IP
  6. emzdesign

    emzdesign Peon

    Messages:
    538
    Likes Received:
    4
    Best Answers:
    0
    Trophy Points:
    0
    #6
    It's probably best if you change your site to use PHP includes (or something similar).

    That way you could have a header.php file and a footer.php and everytime you changed these files it'd change accross the whole site.

    Eg:

    
    <?php include('header.php'); ?>
    
    Content goes here
    
    <?php include('footer.php'); ?>
    
    
    PHP:
     
    emzdesign, Feb 13, 2009 IP
  7. Pixulated

    Pixulated Peon

    Messages:
    71
    Likes Received:
    2
    Best Answers:
    0
    Trophy Points:
    0
    #7
    How do I go about changing my website from html to php?
     
    Pixulated, Feb 14, 2009 IP
  8. hans

    hans Well-Known Member

    Messages:
    2,923
    Likes Received:
    126
    Best Answers:
    1
    Trophy Points:
    173
    #8
    there is no need to change all site into PHP - but make sure you have PHP SSI properly configured, then add small PHP code with your desired text modules via SSI into your pages. this would be very much exactly as I have done to SSI adsense into all my pages and being able to update all at once.

    be careful updating an entire site. think twice what you intend to do as it may change the entire SEO of your site and if you change top of page / title / <head> section you may mess up and loose your current SERPS.

    if however you want to add G adsense or similar at once to all pages - that has NO effect on SERPS as it is javascript only.

    all you finally need to do is to assure your server parses PHP in your HTML pages. a G search for

    parsing php in html pages howto

    depending on server version you may need to add to above G search to get exact .htaccess solution from search for your individual situation ( apache 1.3, apache 2.0, 2.2, etc )
     
    hans, Feb 14, 2009 IP
  9. Asus-Games

    Asus-Games Peon

    Messages:
    582
    Likes Received:
    18
    Best Answers:
    0
    Trophy Points:
    0
    #9
    You don't have to change it. Simply put, If you have an html file you can put php code in it. The files you "include" have to be .php files. It's really easy to do something like this.

    1. Copy the header out of a file, and paste it into a file called header.php, which you will need to create.

    2. Copy the footer out of a file, and paste it into a file called footer.php, which you will need to create.

    3. Delete the code that contains the header on all of the HTML files and replace it with: <?php include('header.php'); ?>

    4. Delete the code that contains the footer on all of the HTML files and replace it with: <?php include('footer.php'); ?>


    When you want to update the header or footer simply open the file and edit the code as if it were HTML and not php. It works just as well plus it's simple!


    ---
    Like My Posts? Leave Me Rep+
     
    Asus-Games, Feb 14, 2009 IP