How to run php code in protected page?

Discussion in 'Troubleshooting' started by behdad, Jan 15, 2015.

  1. behdad

    behdad New Member

    Joined:
    Jan 15, 2015
    Messages:
    3
    Hello everyone,
    I have a question,
    Is it possible to run a php code in protected page?
    For example I want to insert echo "hi" in my page?
    How to do this?
    Thanks.
  2. thehpmc

    thehpmc aMember Pro Customer

    Joined:
    Aug 24, 2006
    Messages:
    901
    Yes if it is a php page.

    If it is in the body of HTML code then just insert
    PHP:
    <?php 
    echo "Hi"
    ?>
  3. behdad

    behdad New Member

    Joined:
    Jan 15, 2015
    Messages:
    3
    Hi
    I know that
    but I have some protected page and it has some php code that I want to run but I can't run it.
    Actually I have a page name VIP.php that I want to protect it is there any way I can include a page or something from aMember engine so a custom member that have a member ship can read this page?
  4. behdad

    behdad New Member

    Joined:
    Jan 15, 2015
    Messages:
    3
    @thehpmc
    Can you help me?
    I really need help :(
  5. edward_shephard

    edward_shephard aMember Pro Customer

    Joined:
    Aug 22, 2014
    Messages:
    41
  6. thehpmc

    thehpmc aMember Pro Customer

    Joined:
    Aug 24, 2006
    Messages:
    901
    Instructions for basic PHP page is in the instructions referred to in previous post.

    This will present the page if member is already logged in or, if not the login form. If they are a member which doesn't have correct membership to give access access then they are treated in the normal aMember way and taken to page which says they do not have correct permissions and need to subscribe to other category to gain access.

    If this is what you are wanting then follow above instructions and it should work. However if you want those not eligible for access to be taken to an 'up-sell' page then the above can be modified to do this. If you want an example of this then please let me know web address of 'up-sell' page and address of the page they can view with appropriate permissions.

    Also are you planning this with just single page or a number of pages? If so easier to put your PHP scripts into a protected directory.

Share This Page