If someone wants to call your .inc file like http://www.my.site/lib.inc they will see the code, as it is a text file. OK, we all know that.
As the .inc file is in reality a renamed php script, containing variables, functions, etc, if you call it .php instead of .inc, it will be parsed by PHP, but as you have no output (echo or print() ), you will just see a blank page. To illustrate better, I use a large (20k) PHP library on my site. It was called stdlib.inc, but because of the problem listing .inc files, I renamed it stdlib.php. If you want to test, look here. You should only see a blank page, and not 1200 lines of code! http://www.dlpage.com/lib/stdlib.php Cheers, Daniel "Sid" <[EMAIL PROTECTED]> a écrit dans le message news: [EMAIL PROTECTED] > Hi, > > I have a php script which includes .inc files. Is there any way in which I > can prevent a normal surferfrom viewing these files. Is there any command > that I can add to a .htaccess file. > > Thanks > > ~~~~~~~~~~~~~~~~~~~~~~~~~~~ \\\\\\__________________________________ > ! SIDDHARTH HEGDE / CHAOSGAMERZ.COM ! > ! Webmaster \____ For PC Game screeshots, cheat ! > ! http://www.ChaosGamerz.COM o| o codes, trainers, downloads, ! > ! [EMAIL PROTECTED]( |_ game music, FREE e-mail and even ! > ! ICQ 84475206 |-- FREE FULL VERSION games for that ! > ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ \___/ 486------------------------------ > -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php