Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations wOOdy-Soft on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

protecting scripts

Status
Not open for further replies.

math

Programmer
Mar 21, 2001
56
BE
Hi,

Is there a way to protect php-scripts?
Like for connecting to mysql, I have a php-file where pasword etc... are kept, I thought of putting those files in a separate folder but I can't seem to get the right chmod settings, I'd like the scripts to be able to access them but the user(s) shouldn't be able, So far I can only do one of them, but not both, does anybody have an idea?

It's not only for password, I also have scripts that should only be run at certain times (only the admin) or just when a certain thing occurs... If the users can run them separetly, They can damage the database and so on...

All idea's are welcome !!
Thanx in advance !!
math
 
why you don't put them in restricted areas, and only run when some user call them?

for example, use $user_level

<?
session_start();
if ($user_level!='Admin') Header (&quot;Location: /&quot;);
?>

all the users not admin will be redirected to the homepage.

Anikin
Hugo Alexandre Dias
Web-Programmer
anikin_jedi@hotmail.com
 
I think he means if PHP is brought down and the scripts are no longer parsed how do you hide them.

Look up php.net doc_root --BB
 
If your webserver is *nix name them .scriptname by default they will be hidden.
Also most (windows included) versions of apache will hide .files as system files. ______________________________________________________________________
There's no present like the time, they say. - Henry's Cat.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top