English 中文(简体)
• 如何阻挡在PHP所需网页外打电话
原标题:How to block to call function pages outside required pages in PHP

我的根部有一页简便。 It s similar wp-config.php which in termpress system. 名称为config.php>。 我的档案(功能s.php)中有一些我的薄膜或一般页面功能。

当用户打电话给我的索引页时,它装上了汇合点(或其他功能页)。 但是,我想要使这些用户不受外部呼吁的影响:一是在进入我的主人.com/<>confem>config.php时,他们要阻挡或重新引导用户。

页: 1 是否有任何办法?

2. If is/isn t, does it matter for security? I don t know about security but it bothers me when i think.

问题回答

如评论中所建议的,你可以限制查阅这些档案,使用“htaccess”或简单核对预先确定的变量。 最好的做法是将这些档案放在一条无法从网上读到的路上,并从那里收到。

页: 1 将其列入母体目录(/var/www/your_site_dir),不需要其他限制。

至于它是否影响到安全......,这取决于你们的法典是如何起草的,但是,你总是应该限制与这些法典的接触。 没有一个系统是100%的安全,如果某些人甚至有条件地获得提供给他们的资源,那么任何系统都不会被视为安全。

首先,在你所包括的档案中不采用可执行的规则。 这样,即使他们被直接指名,也不会发生任何事情,因为他们界定了等级/职能,但没有执行。

其次,如果你能够保护他们,“<>Narf建议你用以下方式开始所有档案:

<?php
  if (!defined( IN_APP )) {
    exit();
  }

And in you application add define( IN_APP , true)

In this way if your file is called directly, it will just exit.





相关问题
Brute-force/DoS prevention in PHP [closed]

I am trying to write a script to prevent brute-force login attempts in a website I m building. The logic goes something like this: User sends login information. Check if username and password is ...

please can anyone check this while loop and if condition

<?php $con=mysql_connect("localhost","mts","mts"); if(!con) { die( unable to connect . mysql_error()); } mysql_select_db("mts",$con); /* date_default_timezone_set ("Asia/Calcutta"); $date = ...

定值美元

如何确认来自正确来源的数字。

Generating a drop down list of timezones with PHP

Most sites need some way to show the dates on the site in the users preferred timezone. Below are two lists that I found and then one method using the built in PHP DateTime class in PHP 5. I need ...

Text as watermarking in PHP

I want to create text as a watermark for an image. the water mark should have the following properties front: Impact color: white opacity: 31% Font style: regular, bold Bevel and Emboss size: 30 ...

How does php cast boolean variables?

How does php cast boolean variables? I was trying to save a boolean value to an array: $result["Users"]["is_login"] = true; but when I use debug the is_login value is blank. and when I do ...

热门标签