这方面是我档案结构的一个例子。
/index.php
/inc
/inc/file1.php
/inc/file2.php
/inc/file3.php
/search.php
index.php includes() file1.php, file2.php, and file3.php. And I want them to be accessible by index.php only.
有哪些最可取的解决办法?
增 编
这方面是我档案结构的一个例子。
/index.php
/inc
/inc/file1.php
/inc/file2.php
/inc/file3.php
/search.php
index.php includes() file1.php, file2.php, and file3.php. And I want them to be accessible by index.php only.
有哪些最可取的解决办法?
增 编
将它们排除在文件之外:
/documentroot/index.php
/inc/file1.php
/inc/file2.php
/inc/file3.php
因此,无法直接接触他们。
指数。 你可以这样界定:
define( RESTRICTED ,1);
Then in your other pages you put this after <?php
if(!defined( RESTRICTED ))exit( No direct script access allowed! );
When the other pages are accessed directly the code above sees that RESTRICTED has not been set, hence it will exit.
a. 编造“htaccess”文档,将其放在“inc”上。
<Files .htaccess>
order allow,deny
deny from all
</Files>
<Files *.php>
order allow,deny
deny from all
</Files>
或将此事放在你想要nie的档案上。
if(strrchr($_SERVER[ PHP_SELF ], / )== /file_name.php ){die;} // not good for ajax include
I am using CodeIgniter 1.7.2 with XAMPP 1.7.2 on a Windows computer. I am trying to make use of SimplePie. I followed all the instructions I could find: a copy of simplepie.inc is in my applications/...
I have an apache server running, with mongrels underneath running rails. The apache config file for my rails app looks like this: <VirtualHost *:80> ServerName trunk.production.charanga ...
I have developed over 50 sites that all use the exact same files other than CSS and IMAGES, I currently duplicate the files each time I create a new site and upload different css and images. What ...
I finish a litle http server, writing from scratch. I would like to be sure that my imlementation is conforme to the HTTP specifications. W3C give us tools for HTML/XML conformance, but i see nothing ...
I ve tried searching for this but it s pretty difficult to put into words. Basically, our site will run fine for most users without any issues. Sometimes though, those of us who use the site pretty ...
I would like to submit a form to a CGI script localy (w3c-markup-validator), but it is too slow using curl and apache, I want to use this CGI script more than 5,000 times in an another script. and ...
I am using curl like this: curl -s -F "uploaded_file=@/path_to_file;type=text/html" -F output=soap12 http://localhost/w3c-markup-validator/check >text.xml && xsltproc script/guilbep_soap_w3c....
I am serving my FastCGI application in Apache2 using the standalone FastCGI server and the FastCgiExternalServer directive. When I restart my FastCGI app my users get a 500 error. What can I do to ...