Jump to content

Recommended Posts

As long as your file ends in a .php extension so that it will be parsed if someone browses to it, no one can see the code or data in the file (unless they have direct access to the file through FTP or direct access to your computer.)

 

Give it a try, browse to your file and see what you get.

Link to comment
https://forums.phpfreaks.com/topic/82929-permissions/#findComment-421770
Share on other sites

Well you could place a .htaccess file in that folder to deny access, or just simply place an blank index.html file in that folder so when a user goes directly to Www.sitename.com/grwgwgd all they'll get is a blank page, or if you go the .htaccess route a 403 Forbidden error.

Link to comment
https://forums.phpfreaks.com/topic/82929-permissions/#findComment-421783
Share on other sites

Try what PFMaBiSmAd suggested.

 

PHP is rendered server side, and anything between the <? and ?> brackets is NOT shown to the end user.

 

Your first question and second are two completed different things. PFMaBiSmAd answered your first question correctly.

 

Answer to your second question, create an .htaccess file.

 

1.) Open notepad

2.) copy and paste "Options -Indexes"

3.) save as .htaccess (make sure it's not saved with a .txt extension)

4.) move that file to your root (htdocs) folder

5.) open www.sitename.com/grwgwgd, you should get a 403 Access Forbidden error.

Link to comment
https://forums.phpfreaks.com/topic/82929-permissions/#findComment-421784
Share on other sites

No need for the php tags just the configuration code. Also the .htaccess has no filename eg: the following is incorrect: filename.htaccess

 

it's just .htaccess

 

When creating this file with Notepad, make sure the File Type pull down menu is set to All Files and not Text Document

Link to comment
https://forums.phpfreaks.com/topic/82929-permissions/#findComment-421790
Share on other sites

Exactly what wildteen88 said.

 

Kepp in mind though, if you put this .htaccess file in your root directory EVERY directory underneath it will be disallowed from giving a directory listing.

 

ex.

root

|

images

\

members

 

If you wanted to say, disallow directory display of all directories, except members, you'd make a .htaccess file with "Options +Indexes" and place it in the members. root & images would then be disallowed from showing the index, but members, and any subfolders contained within it, would show.

 

In short, .htaccess files cascade down the directory structure.

Link to comment
https://forums.phpfreaks.com/topic/82929-permissions/#findComment-421802
Share on other sites

If you have an index page, whether it is .php, .pl, .cfm or  whatever. the user will only be able to view that page. If they go to www.sitename.com/grwgwgd

it will automatically take them to www.sitename.com/grwgwgd/index.[extension], so they can't see the files in that folder.

 

Sam

 

Link to comment
https://forums.phpfreaks.com/topic/82929-permissions/#findComment-421832
Share on other sites

Now, go to www.sitename.com/grwgwgd/ and you should get the 404 Error.

 

If you dont get anything, check you .htaccess file, it should have just

Options -Indexes

As you can see, if only has one space, then save the file with .htaccess and upload it, then go to www.sitename.com/grwgwgd/ it should work now

Link to comment
https://forums.phpfreaks.com/topic/82929-permissions/#findComment-422099
Share on other sites

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.