Run some PHP code before every request or PHP file?

Discussion in 'PHP' started by karabas, Jan 23, 2009.

  1. #1
    Is there some way I can configure web server to execute some PHP code before actual PHP page is interpreted or force include PHP code into every PHP file of my webapp similar to force include option in Visual C++?
     
    karabas, Jan 23, 2009 IP
  2. EricBruggema

    EricBruggema Well-Known Member

    Messages:
    1,740
    Likes Received:
    28
    Best Answers:
    13
    Trophy Points:
    175
    #2
    try using htaccess! :)
     
    EricBruggema, Jan 23, 2009 IP
  3. bbrez1

    bbrez1 Banned

    Messages:
    208
    Likes Received:
    3
    Best Answers:
    0
    Trophy Points:
    0
    #3
    karabas, why not just include a file on top of the file?
     
    bbrez1, Jan 23, 2009 IP
  4. karabas

    karabas Well-Known Member

    Messages:
    659
    Likes Received:
    13
    Best Answers:
    0
    Trophy Points:
    138
    #4
    I want to run the code on top of other CMS applications like Wordpress etc and really would like to avoid messing with their code.

    For the same reason I would like to avoid using .htaccess
     
    karabas, Jan 23, 2009 IP
  5. joebert

    joebert Well-Known Member

    Messages:
    2,150
    Likes Received:
    88
    Best Answers:
    0
    Trophy Points:
    145
  6. bbrez1

    bbrez1 Banned

    Messages:
    208
    Likes Received:
    3
    Best Answers:
    0
    Trophy Points:
    0
    #6
    bbrez1, Jan 24, 2009 IP