How to lock files in public_html for normal user

I ask a question some minutes ago and closed it to fare because I’m new hear. Sry guys!
The okder question: Folders beside public_html

is there any possibility to lock files, so a user couldn’t maneuver to a file like https:// mywebsite.000webhostapp. com/public_html/private_html/style.css (this is only an example) but I can?

I wold like to lock the whole folder …/private_html

thanks for your help

@Stefan_U Yes you can lock “private_html” present in “public_html” with username and password.
This tutorial will help you.

thanks for the answer but this is not acutely what i want.

Is there any possibility that i file in the login for the secure folder by click on a bottom?

I want a folder which is locked for maneuver by the user with a clear way like this https:// mywebsite.000webhostapp. com/public_html/private_html/style.css,
but when i want to bring them to the site with a bottom it should be work.

the main idea is:
I open a script in a HTML so if the user look up the sitetext he can see that I open an other script but couldn’t read it, right now.
But he see were he have to maneuver for it, he could go on his one only to the script and read out the sidetext.
This I would like to prevent with a locked folder were i get the information for my user but he couldn’t maneuver to it!
Maybe this function isn’t feasible :’/

Hi @Stefan_U!

I open a script in a HTML so if the user look up the sitetext he can see that I open an other script but couldn’t read it, right now.

If your script is linked to the webpage, trust me: he can read it.

This I would like to prevent with a locked folder were i get the information for my user but he couldn’t maneuver to it!

If I got it correctly, there is no way you can do this unless you’re using some obfuscations in your script. Like encoding it in base64, or encrypting it, however it can still be viewable if you’re digging into it.

Hi @NGiNX

I mean a html object, the “object” were taken.

I think now that it wouldn’t work!! :’/
sometimes i have an idea which i like to run it until it won’t and that i have to accept

Thanks for your help guys

I am not sure what you are referring to… :confused:

When you have a site like index.html und you have a other file login.php.
In index.html you have a nice few of a site with a head-, side-menu and a mainplace were is writen text.
In login.php is only the login script with a Username input, a passwort input and a buttom.

When you now in the index.html in the mainplace instead the text a <object type="text/php" data="login.php" width="100px" height="100px"></object> use.
you will see the index.html with the menu’s and login.php in the mainplace.

so when i want i can decide essayer to other files to fill in.
i hope i discrip it clear enough

Oh… Now I understand!

And you say you want to mask the location of the data= attribute?

1 Like

I am afraid that is not possible. Unless you are using some obfuscations with Javascript and/or PHP.

i actually use php and maybe i found a way how i can use it on my way
right now it doesn’t run correctly, i will give some conclusion the next days

my way i tryed now was;

  • i include a script which i will need in the moment in the head script in the part of the <object> (<object width=100px" height="100px"><?php include($inhalt); ?></object>)
  • when i finisch with it i include a other script (that i define in if-questions in php)
  • and so on

the included scripts were all readable (only the part which were necessary to print the site) but the user couldn’t go on his one to the sites, because there are on the same level like “public_html” in a other folder.

That is not actually what i want!!!
But for me the best result, with i can live and up my website

I hope you can get it
And thanks for your help

Make a main.css for css design.
In your index.php type:

<style>
<?php echo file_get_contents('main.css'); ?>
</style> 

That way, the user will only see the stylesheet but will not be able to know where the main.css is.

This topic was automatically closed after 29 days. New replies are no longer allowed.