Hello and welcome to our community! Is this your first visit?
Register
Enjoy an ad free experience by logging in. Not a member yet? Register.
Results 1 to 8 of 8
  1. #1
    New to the CF scene
    Join Date
    Nov 2011
    Posts
    4
    Thanks
    4
    Thanked 0 Times in 0 Posts

    alternative to cut and paste

    I use an image at the top of a dozen or so pages - rectangular coordinates are used to select the page

    <area shape="rect" coords="150,200,300,250" href="general_ledger.html" alt="" />
    <area shape="rect" coords="300,200,450,250" href="checkbook.html" alt="" />
    and so on....

    I paste the same dozen dozen lines at the start of the body of each page

    I also have a footer which is the same for each page - again, I paste the code to each page

    there must be a better way - can someone point me in the right direction

  • #2
    Senior Coder
    Join Date
    Aug 2006
    Posts
    1,405
    Thanks
    11
    Thanked 298 Times in 297 Posts
    Do a search for "PHP Include" or "Server Side Include" - that's what you want.

    Dave

  • Users who have thanked tracknut for this post:

    carl47 (11-21-2011)

  • #3
    New to the CF scene
    Join Date
    Oct 2011
    Posts
    4
    Thanks
    0
    Thanked 2 Times in 2 Posts
    Dave is right, I would suggest using a server side include. That way, you'll modify it once to make the changes across the site.

  • Users who have thanked TimS for this post:

    carl47 (11-21-2011)

  • #4
    Master Coder Excavator's Avatar
    Join Date
    Dec 2006
    Location
    Alaska
    Posts
    9,695
    Thanks
    22
    Thanked 1,832 Times in 1,816 Posts
    Hello carl47,
    Here is an easy to follow totorial on php includes - http://www.tizag.com/phpT/include.php
    Validate often DURING development - Use it like a splelchecker | Debug during Development |Write it for FireFox, ignore IE
    Use the right DocType | Validate your markup | Validate your CSS | Why validating is good | Why tables are bad

  • Users who have thanked Excavator for this post:

    carl47 (11-21-2011)

  • #5
    New to the CF scene
    Join Date
    Nov 2011
    Posts
    4
    Thanks
    4
    Thanked 0 Times in 0 Posts
    just getting "include/require" working - thanks to all for pointing me in the right direction

    but... now looking at WC3 validation and <?php require("menu.php"); ?>

    for page.html and HTML 5 and no <?php I get 1 warning

    for page.html with <?php I get 1 warning and 1 error for the <?php and page.html does not bring in the menu code

    for page.php with <?php W3C tells me the doc cannot be checked, but the menu code is properly applied

    it seems like every page with <?php must have a php extension, but the WC3 validator does not seem to like .php - where now?

  • #6
    Kor
    Kor is offline
    Red Devil Mod Kor's Avatar
    Join Date
    Apr 2003
    Location
    Bucharest, ROMANIA
    Posts
    8,478
    Thanks
    58
    Thanked 379 Times in 375 Posts
    W3C tool validates the HTML generated code, not the server-side languages code . If you want to validate something, validate what you see when you open View Page Source.
    KOR
    Offshore programming
    -*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*

  • Users who have thanked Kor for this post:

    carl47 (11-21-2011)

  • #7
    New to the CF scene
    Join Date
    Nov 2011
    Posts
    4
    Thanks
    4
    Thanked 0 Times in 0 Posts
    yes - I understand what you mean and it works fine!

  • #8
    New to the CF scene
    Join Date
    Nov 2011
    Posts
    4
    Thanks
    4
    Thanked 0 Times in 0 Posts
    Guys -

    Once again wanted to thank all of you! I am not a master of HTML5 - and will only use it for my own web site - but I have developed a reasonable understanding of boxes, divs, tables and lists to send my php files to the W3C as htm and feel confident they validate without any issues other than those arising from my php header and footer.

    Eventually I would have figured it out on my own. But, you probably shaved six months off the experience.

    Once again - Thanks

    carl47


  •  

    Posting Permissions

    • You may not post new threads
    • You may not post replies
    • You may not post attachments
    • You may not edit your posts
    •