eddedwards Posted May 5, 2006 Share Posted May 5, 2006 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 Link to comment https://forums.phpfreaks.com/topic/9135-how-can-i-block-scripts-from-being-downloaded/ Share on other sites More sharing options...
gluck Posted May 5, 2006 Share Posted May 5, 2006 [!--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. Quote Link to comment https://forums.phpfreaks.com/topic/9135-how-can-i-block-scripts-from-being-downloaded/#findComment-33720 Share on other sites More sharing options...
sKunKbad Posted May 6, 2006 Share Posted May 6, 2006 [!--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. Quote Link to comment https://forums.phpfreaks.com/topic/9135-how-can-i-block-scripts-from-being-downloaded/#findComment-33768 Share on other sites More sharing options...
eddedwards Posted May 6, 2006 Author Share Posted May 6, 2006 ive heard about using .htaccess thats something im about to learn about. but ive not heard of the CHMOD whats that about? Quote Link to comment https://forums.phpfreaks.com/topic/9135-how-can-i-block-scripts-from-being-downloaded/#findComment-33844 Share on other sites More sharing options...
AndyB Posted May 6, 2006 Share Posted May 6, 2006 CHange MODe tutorial -> [a href=\"http://catcode.com/teachmod/\" target=\"_blank\"]http://catcode.com/teachmod/[/a] - it's about changing 'permissions' Quote Link to comment https://forums.phpfreaks.com/topic/9135-how-can-i-block-scripts-from-being-downloaded/#findComment-33852 Share on other sites More sharing options...
eddedwards Posted May 9, 2006 Author Share Posted May 9, 2006 thanks. that has helped me a lot. Quote Link to comment https://forums.phpfreaks.com/topic/9135-how-can-i-block-scripts-from-being-downloaded/#findComment-34542 Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.