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 IamaSherpa on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

include file <hide the source>

Status
Not open for further replies.

Guest_imported

New member
Jan 1, 1970
0
I have a question about including files. When I include a file and then view the source, the souce code and the souce code from the included file shows up. My question is how do I hide the source code of the included file?
 
you could put a simple javascript function that allows no right clicking to view source.....I may be wrong there may be way better ways of doing this...if you need assistance on creating this function just reply asking!!

CS
 
Thats an idea but it doesn't stop the user from going to the the view drop down menu and selecting souce(IE)... Thanks anyway.
 
yeah i know it doesn't...but the general user doesn;t realize this...there must ba a more efficient way....I would also like to know!!

CS
 
There is an FAQ about this in the Javascript FAQs, faq216-355
 
What extension is on the include file? Is it .inc? What is contained in the include file?

ASP used to use the extension .inc in their include files but all you had to do was type in the file name in the address bar and you could view the include file. A solution to that problem was to replace your .inc extensions with .asp so if your include file has a .inc extension or whatever it is try putting a .php extesion on it just for a test.
 
Is a PHP file? Apache hides the source of programs when runs it! Do you want to hide another thing?
I hope it works...
Unix was made by and for smart people.
 
Yeah, I don't understand what you're hiding. No PHP code is shown to the user, just the resulting HTML.
 
When you want to protect your .inc files for people so they can't download then and view your db connections (for instance) you need to protect them in the httpd.conf.
There is another way and that is renaming the extension to php, people cant view there sorce either.

Hiding source-code with javascript is one think is not correct. There is no way to protect the html from being viewed. And why should you? How did you learn html, did we not all requested sources to learn more... mcvdmvs
-- "It never hurts to help" -- Eek the Cat
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top