Jump to content

Archived

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

eddedwards

how can i block scripts from being downloaded?

Recommended Posts

is there some way i can store files somewhere that will stop someone running something to steal my source code of my php files. or a way of having a validation script in each file to find out where it was run from and exit if its not the right place?

Share this post


Link to post
Share on other sites
[!--quoteo(post=371561:date=May 5 2006, 09:57 AM:name=Steady_Eddie)--][div class=\'quotetop\']QUOTE(Steady_Eddie @ May 5 2006, 09:57 AM) [snapback]371561[/snapback][/div][div class=\'quotemain\'][!--quotec--]
is there some way i can store files somewhere that will stop someone running something to steal my source code of my php files. or a way of having a validation script in each file to find out where it was run from and exit if its not the right place?
[/quote]

Php files are at your server and web users can not download them like JavaScript. Now if you are concerned about the security of your server then check security of your server so no one hacks in. Hide directory listing, adding passwords etc can be done through web servers.
I don't how a person would be able to execute your script from another location. Anyway you can get the location of the script, script name etc. from the server vars. Refer manual for the funtion.

Share this post


Link to post
Share on other sites
[!--quoteo(post=371561:date=May 5 2006, 07:57 AM:name=Steady_Eddie)--][div class=\'quotetop\']QUOTE(Steady_Eddie @ May 5 2006, 07:57 AM) [snapback]371561[/snapback][/div][div class=\'quotemain\'][!--quotec--]
is there some way i can store files somewhere that will stop someone running something to steal my source code of my php files. or a way of having a validation script in each file to find out where it was run from and exit if its not the right place?
[/quote]

You can use CHMOD or .htaccess.
You should not name your includes with a .inc file extension unless your server is set to process .inc as .php. Store your db connection include above root, and require it.
I used a "deny from all" .htaccess file in my includes folder, but then after I changed the location to above root, I use a CHMOD of 001 on that folder.

Share this post


Link to post
Share on other sites
ive heard about using .htaccess thats something im about to learn about. but ive not heard of the CHMOD whats that about?

Share this post


Link to post
Share on other sites
CHange MODe tutorial -> [a href=\"http://catcode.com/teachmod/\" target=\"_blank\"]http://catcode.com/teachmod/[/a] - it's about changing 'permissions'

Share this post


Link to post
Share on other sites

×

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.