latest stable versions: v150827 (changelog)

Old Forums (READ-ONLY): The community now lives at WP Sharks™. If you have an s2Member® Pro question, please use our new Support System.

Protecting PHP file outside of WP directory

Home Forums Community Forum Protecting PHP file outside of WP directory

This topic contains 0 replies, has 1 voice. Last updated by  Kris Erlewine 4 years, 7 months ago.

Topic Author Topic
Posted: Thursday May 24th, 2012 at 3:18 pm #14499

I have a PHP/MySQL database app in the directory public_html/jobbase outside of WP which is in the directory public_html/wordpress.

I am embedding the main PHP page of the app into a WP page using an iframe. The WP page is protected via S2M. Now I need to protect the PHP page from being accessible outside of S2M.

Following the directions found at http://www.s2member.com/kb/protecting-non-wordpress-content-with-s2member/ I have inserted the following code at the top of my PHP page:

When I try to load the page when logged in as admin or a test user with Level 1 privileges, I get the “Permission denied!” response.

Does something need to replace “// User is allowed to view, so display something here.” to make this function and protect the external (from WP) PHP file?

TIA

  • This topic was modified 4 years, 7 months ago by  Kris Erlewine.
  • This topic was modified 3 years, 4 months ago by  Kris Erlewine.

This topic is closed to new replies. Topics with no replies for 2 weeks are closed automatically.

Old Forums (READ-ONLY): The community now lives at WP Sharks™. If you have an s2Member® Pro question, please use our new Support System.

Contacting s2Member: Please use our Support Center for bug reports, pre-sale questions & technical assistance.