我不敢肯定这是否可行,但不管怎样,你能够不断检查变数在营地的价值,看它是否具有某种价值?
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 ...
我不敢肯定这是否可行,但不管怎样,你能够不断检查变数在营地的价值,看它是否具有某种价值?
这样做的方法可能不会有变化。 如果你称职,你可以采取更详细的行动:
function step() {
static $steps = 0;
if (++$steps === 100) {
header( Location: /foo.php );
}
}
You can then call it with step();
, and the redirect will happen the 100th time the function is called.
请注意,您可使用<代码>_SESSION 变量,或数据库价值,或以任何其他方式储存数据而不是固定变量。
你们正在寻找一个时间过错?
rel=“nofollow”>http://www.php.net/manual/en/debugger-about.php
Try Xdebug, it integrates with some IDEs.
You could choose a eventdriven solution. Build a class that holds your value and that manages (and monitors) the incrementation:
http://www.ohchr.org。
class valueHolder {
private $val = 0;
private $cb = null;
private $trigger = null;
//constructor logic comes here
public function increment() {
$this->val++;
if ( $this->val > $yourValueGoesHere ) {
call_user_func( $this->cb );
}
}
public registerCallback( $cb ) {
$this->cb = $cb;
}
}
<>Usage
$myValue = new valueHolder();
$myValue->registerCallback( function() {
header( "location:fooooo.php" );
} );
$myValue->increment();
$myValue->increment();
$myValue->increment();
$myValue->increment();
//redirection!!!!!!
a. 未检测的警报......;
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 ...
<?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 = ...
I found this script online that creates a thumbnail out of a image but the thumbnail image is created with poor quality how can I improve the quality of the image. And is there a better way to create ...
如何确认来自正确来源的数字。
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 ...
I wonder there is a way to post a message to a facebook business page with cURL? thanks
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? 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 ...