1. Advertising
    y u no do it?

    Advertising (learn more)

    Advertise virtually anything here, with CPM banner ads, CPM email ads and CPC contextual links. You can target relevant areas of the site and show ads based on geographical location of the user if you wish.

    Starts at just $1 per CPM or $0.10 per CPC.

One menu for all pages

Discussion in 'HTML & Website Design' started by kgrad, Jan 19, 2007.

Thread Status:
Not open for further replies.
  1. twistedspikes

    twistedspikes Notable Member

    Messages:
    5,694
    Likes Received:
    293
    Best Answers:
    0
    Trophy Points:
    280
    #21
    I usually just have them with the .inc extention, no need for the .php at the end.
     
    twistedspikes, Aug 8, 2007 IP
  2. Dan Schulz

    Dan Schulz Peon

    Messages:
    6,032
    Likes Received:
    436
    Best Answers:
    0
    Trophy Points:
    0
    #22
    Which means that your includes are sent as plain text. If you contain sensitive data like SQL data, usernames or passwords, you'll have just given a cracker access to your site.

    Of course, I did forget to mention that includes should be kept outside the Web (or www or html_public) directory for precisely this reason.
     
    Dan Schulz, Aug 8, 2007 IP
    Halobitt likes this.
  3. twistedspikes

    twistedspikes Notable Member

    Messages:
    5,694
    Likes Received:
    293
    Best Answers:
    0
    Trophy Points:
    280
    #23
    oh right, never knew that. Thanks. Good job they arnt then
     
    twistedspikes, Aug 8, 2007 IP
  4. drywallinfoman

    drywallinfoman Peon

    Messages:
    30
    Likes Received:
    0
    Best Answers:
    0
    Trophy Points:
    0
    #24
    To any reading all of these posts with a little bit of apprehension: Server Side Includes are VERY easy!

    Design your site the way you want it. Then cut and paste your common menu items, etc into a text file or blank html file. Replace the cut content with the server prompt that calls up the file you just created. On your server, you may need to set up a .htaccess file. All you do is create a new file in your public folder and name it .htaccess Then add the commands as mentioned in the previous thread. Or, perhaps your server has an "Add Apache Handlers" function. To be sure, contact your server tech support.

    Once all of this is done, the only thing you need to do is update your ONE file as needed, and every single page on your site will be updated with that content. SSI's are the best thing I have ever used with regard to site maintenance.
     
    drywallinfoman, Feb 26, 2008 IP
  5. drywallinfoman

    drywallinfoman Peon

    Messages:
    30
    Likes Received:
    0
    Best Answers:
    0
    Trophy Points:
    0
    #25
    So you are saying outsiders have access to the contents if they are plain text? I am assuming this would be a problem in a server-side language like PHP where your username and password are not normally seen. Would a person then see the name of the file somehow and then simply type in it's address directly? How could they do this?

    I have not yet used SSI's containing PHP code, but have considered it.
     
    drywallinfoman, Feb 26, 2008 IP
  6. Dan Schulz

    Dan Schulz Peon

    Messages:
    6,032
    Likes Received:
    436
    Best Answers:
    0
    Trophy Points:
    0
    #26
    If you're going to use PHP's include function to hold sensitive data, such as MySQL calls, save the file with the .php file extension.
     
    Dan Schulz, Feb 26, 2008 IP
  7. IndiaNets

    IndiaNets Guest

    Best Answers:
    0
    #27
    Wow... I'm sorry for posting in this aged thread.. but still I can't stop this...

    The informations here are really great and I think it will help people for years.
    If it is organized in a website it will be a great one in itself :)
    Thanks web guru Dan specially.. as you are simply great.

    Thank you all
    Vijay
     
    IndiaNets, Mar 9, 2008 IP
  8. Dan Schulz

    Dan Schulz Peon

    Messages:
    6,032
    Likes Received:
    436
    Best Answers:
    0
    Trophy Points:
    0
    #28
    Don't worry about it. There's a reason why I have this thread linked in my signature - I think it's useful to others - especially those that are learning. :)
     
    Dan Schulz, Mar 9, 2008 IP
  9. fuzzbuzz

    fuzzbuzz Active Member

    Messages:
    315
    Likes Received:
    2
    Best Answers:
    0
    Trophy Points:
    53
    #29
    Are .shtml pages any less SEO friendly?

    If my pages are .shtml and someone types domainname.com/ will the homepage still appear?

    Also i dont seem to understand how using .htaccess i can make .shtml look like .html. Any help would be appreciated.

    Thanks in advance.

    fuzz
     
    fuzzbuzz, Apr 23, 2008 IP
  10. Dan Schulz

    Dan Schulz Peon

    Messages:
    6,032
    Likes Received:
    436
    Best Answers:
    0
    Trophy Points:
    0
    #30
    Dan Schulz, Apr 23, 2008 IP
  11. scutari

    scutari Peon

    Messages:
    431
    Likes Received:
    5
    Best Answers:
    0
    Trophy Points:
    0
    #31
    very useful article, but i HAVE A QUESTION? How do we define the $Document_root var, or just please explain that last sentence?
     
    scutari, May 9, 2008 IP
  12. Dan Schulz

    Dan Schulz Peon

    Messages:
    6,032
    Likes Received:
    436
    Best Answers:
    0
    Trophy Points:
    0
    #32
    It's been pre-defined by the language itself. In other words, just drop it in and give it a go.

    For example,

    
    <?php include($DOCUMENT_ROOT . "/includes/menu.inc.php"); ?>
    
    Code (markup):
    Would look for a PHP file called "menu.inc.php" at www.example.com/includes/menu.inc.php regardless of what page the menu is being called from (such as www.example.com or www.example.com/category/sub-category/page.php for instance). It's basically a nice shortcut and an easy way to avoid having to type out the complete URL path for the included file.
     
    Dan Schulz, May 9, 2008 IP
  13. scutari

    scutari Peon

    Messages:
    431
    Likes Received:
    5
    Best Answers:
    0
    Trophy Points:
    0
    #33
    well, you suggest to be doing this when your website grows and you have to create new directories, and cannot access the root from those new ones with the include server side. I get it.

    Well what is the .inc extension?
     
    scutari, May 9, 2008 IP
  14. Dan Schulz

    Dan Schulz Peon

    Messages:
    6,032
    Likes Received:
    436
    Best Answers:
    0
    Trophy Points:
    0
    #34
    It's short for "include" - basically it's an easy way to remember that it's an included file, rather than a template file, or a script.
     
    Dan Schulz, May 9, 2008 IP
    scutari likes this.
  15. scutari

    scutari Peon

    Messages:
    431
    Likes Received:
    5
    Best Answers:
    0
    Trophy Points:
    0
    #35
    very useful information Dan, you deserve some reputation:)
     
    scutari, May 10, 2008 IP
  16. hugl3

    hugl3 Peon

    Messages:
    18
    Likes Received:
    0
    Best Answers:
    0
    Trophy Points:
    0
    #36
    Hello Dan Schulz, and thanks!

    Actually today I was playing with includes and didn't add the .php at the end - and get what happened. I was able to see the content. Thanks for help.

    I was lucky to find this article on time.

    cheers
     
    hugl3, Jun 3, 2008 IP
  17. Dan Schulz

    Dan Schulz Peon

    Messages:
    6,032
    Likes Received:
    436
    Best Answers:
    0
    Trophy Points:
    0
    #37
    You're welcome. :)
     
    Dan Schulz, Jun 3, 2008 IP
  18. kgrad

    kgrad Well-Known Member

    Messages:
    2,414
    Likes Received:
    82
    Best Answers:
    0
    Trophy Points:
    130
    #38
    This should have been your thread, not mine. :):eek:
     
    kgrad, Jun 3, 2008 IP
  19. Dan Schulz

    Dan Schulz Peon

    Messages:
    6,032
    Likes Received:
    436
    Best Answers:
    0
    Trophy Points:
    0
    #39
    Hey, I just figured people would find it useful, so I linked to it in my signature. I never figured it would last THIS long.
     
    Dan Schulz, Jun 3, 2008 IP
  20. Traffic-Bug

    Traffic-Bug Active Member

    Messages:
    1,866
    Likes Received:
    8
    Best Answers:
    0
    Trophy Points:
    80
    #40
    If you have used include file then this also makes the page more maintainable.
     
    Traffic-Bug, Oct 5, 2009 IP
Thread Status:
Not open for further replies.