Jump to content

how can i block scripts from being downloaded?


eddedwards

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?
Link to comment
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.
Link to comment
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.
Link to comment
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.