Set code to all pages...

Discussion in 'Site & Server Administration' started by jac4593, Feb 24, 2008.

  1. #1
    in my server?


    So I will have a code and it will be inserted to all pages in my server automatically. I'm not sure if there's such a thing but just in case someone here knows how.

    Ask if you want more details and stuff.
     
    jac4593, Feb 24, 2008 IP
  2. login

    login Notable Member

    Messages:
    8,849
    Likes Received:
    349
    Best Answers:
    0
    Trophy Points:
    280
    #2
    You can just make a file called code.php and insert it on all your pages with php.
     
    login, Feb 24, 2008 IP
  3. kaung

    kaung Twitter @KaungKo

    Messages:
    4,040
    Likes Received:
    187
    Best Answers:
    0
    Trophy Points:
    155
    #3
    to add to that, create code.php as login said or whatever.php
    and put it as require or include in your other pages or sites by calling

    <?php include('linkto/code.php');?>
    Code (markup):
    in the pages and place where you want stuffs/contents from code.php to show
     
    kaung, Feb 24, 2008 IP
  4. login

    login Notable Member

    Messages:
    8,849
    Likes Received:
    349
    Best Answers:
    0
    Trophy Points:
    280
    #4
    And to add to that.

    If you have many sites the code will be:

    <?php include('http://www.yoursitewiththecodefolder.com/code.php');?>
     
    login, Feb 25, 2008 IP
  5. Pwner

    Pwner Peon

    Messages:
    176
    Likes Received:
    6
    Best Answers:
    0
    Trophy Points:
    0
    #5
    Hello, add auto_prepend_file or auto_append_file in your php.ini, with auto_prepend_file the file is parsed before the main php and with auto_append_file after the main php, be careful because if the main php is terminated with exit() auto_append_file will not work.

    for example

    auto_prepend_file = pathtothephpfile/code.php
     
    Pwner, Feb 25, 2008 IP