Jump to content

Restrict access to folder


DimisD

Recommended Posts

Hi there,

 

I have a "view.php" page that displays MySql database records for the site visitors.

Inside this page i require one page tha has the database connections info: <?php require_once('Connections/connx_news.php'); ?>

--------------------- connx_news.php ----------------------

<?php

# FileName="Connection_php_mysql.htm"

# Type="MYSQL"

# HTTP="true"

$hostname_connx_news = "localhost";

$database_connx_news = "db_name";

$username_connx_news = "usr_name";

$password_connx_news = "pass";

$connx_news = mysql_pconnect($hostname_connx_news, $username_connx_news, $password_connx_news) or trigger_error(mysql_error(),E_USER_ERROR);

?>

--------------------- - ----------------------

How can i restrict access to the Connections folder? ???

If i do the folder password protected it asks for username & password.

 

Thank you in anticipation!

 

PS. I created the webpage with dreamweaver

 

 

Link to comment
https://forums.phpfreaks.com/topic/142774-restrict-access-to-folder/
Share on other sites

I would recommend first placing an empty index.html file in the folder to prevent people from viewing the directory tree.

 

Second, you can CHMOD the directory to allow only the server/your group to use the file.  I would recommend reading:

http://en.wikipedia.org/wiki/Chmod

http://www.catcode.com/teachmod/

http://www.phpjunkyard.com/ftp-chmod-tutorial.php

 

Those are only a few.  Google "CHMOD" or "FTP CHMOD" or "Change Mode" for even more.  You may have to play with it a bit to get the configuration correct.

Archived

This topic is now archived and is closed to further replies.

×
×
  • 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.