add some php to top of certain pages

Community Forums Forums General Discussion add some php to top of certain pages

This topic is: not resolved

This topic contains 2 replies, has 2 voices, and was last updated by  dev 11 months, 2 weeks ago.

Viewing 3 posts - 1 through 3 (of 3 total)
  • Author
    Posts
  • #61493

    Nomad
    Participant
    Post count: 26

    Hi Guys….i need to add some php at the top of two pages e.g mydomain.com/example and mydomain.com/example-2. the php must be before the page begins as it is a script it needs to “authenticate” before access is granted to the page. Here is an example of what needs to be at the top of the two pages

    <?php
    $index = true;
    require “protect.php”;
    ?>

    Would appreciate some help as to what i need to add to the functions.php file and how to ensure it is page specific…..thanks my brain is a bit numb today it seems =)

    #61504

    dev
    Participant
    Post count: 451
    #61505

    dev
    Participant
    Post count: 451

    There are a bunch of plugins that purport to do this for you. Let us know which one you try and how it worked:

    http://tinyurl.com/qx3fvmn

    Dev

Viewing 3 posts - 1 through 3 (of 3 total)

You must be logged in to reply to this topic.