Jump to content


Photo

how can i block scripts from being downloaded?


  • Please log in to reply
5 replies to this topic

#1 eddedwards

eddedwards
  • Members
  • PipPipPip
  • Advanced Member
  • 31 posts

Posted 05 May 2006 - 02:57 PM

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?

#2 gluck

gluck
  • Members
  • PipPipPip
  • Advanced Member
  • 216 posts

Posted 05 May 2006 - 08:18 PM

[!--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) View Post[/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.
I'm back baby!

#3 sKunKbad

sKunKbad
  • Members
  • PipPipPip
  • Advanced Member
  • 1,832 posts
  • LocationTemecula, CA, USA

Posted 06 May 2006 - 01:16 AM

[!--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) View Post[/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.

Brian's Web Design - Temecula

Freedom is only available through death.

#4 eddedwards

eddedwards
  • Members
  • PipPipPip
  • Advanced Member
  • 31 posts

Posted 06 May 2006 - 02:46 PM

ive heard about using .htaccess thats something im about to learn about. but ive not heard of the CHMOD whats that about?

#5 AndyB

AndyB
  • Staff Alumni
  • Advanced Member
  • 5,465 posts
  • LocationToronto

Posted 06 May 2006 - 03:42 PM

CHange MODe tutorial -> [a href=\"http://catcode.com/teachmod/\" target=\"_blank\"]http://catcode.com/teachmod/[/a] - it's about changing 'permissions'
Legend has it that reading the manual never killed anyone.
My site

#6 eddedwards

eddedwards
  • Members
  • PipPipPip
  • Advanced Member
  • 31 posts

Posted 09 May 2006 - 09:05 AM

thanks. that has helped me a lot.




0 user(s) are reading this topic

0 members, 0 guests, 0 anonymous users