• In one of my php file on my wordpress website I have private code that perform authorisation checking. So I want to be sure nobody (except me of course) can see that code, only can run it.

    How to do that?

    Actually I am quite new in php, wordpress, hosting etc. So I don’t know how it works. Maybe my code is secured by default. I even tried to download my php file as unlogged user and I didn’t find the way how to do that. I tried just type in browser something like: https://www.mywebsite.com/myfile.php

    But it run the php by default which is great. But I need to be sure the php file will never be downloaded by unauthorized user.

    • This topic was modified 4 years, 9 months ago by Jan Dembowski. Reason: Moved to Fixing WordPress, this is not an Developing with WordPress topic
Viewing 3 replies - 1 through 3 (of 3 total)
  • The PHP file cannot be seen its contents for end users. PHP scripts are executed on the server

    Moderator bcworkz

    (@bcworkz)

    What Dicky said is correct, on a properly configured server. If your site is served from a reputable host, it should be correctly configured. You’ve already demonstrated for yourself that it’s configured correctly. Otherwise requesting the .php file would have delivered its code content instead of executing the code. All is well.

    Moderator Jan Dembowski

    (@jdembowski)

    Forum Moderator and Brute Squad

    Moved to Fixing WordPress, this is not an Developing with WordPress topic.

    How to make php file to be secret?

    Generally, you don’t. See above answers, raw PHP code should never come through to the user that way.

Viewing 3 replies - 1 through 3 (of 3 total)
  • The topic ‘How to make php file to be secret?’ is closed to new replies.