Home >Backend Development >PHP Tutorial >$_GET['cat'],$_GET['dog'] Under what circumstances does $v3 equal 1?

$_GET['cat'],$_GET['dog'] Under what circumstances does $v3 equal 1?

WBOY
WBOYOriginal
2016-08-04 09:20:351436browse

<code>$v3 = 0;

$c=@$_GET['cat'];
$d=@$_GET['dog'];
if(@$c[1]){
    
    if(!strcmp($c[1],$d) && $c[1]!==$d){
        echo $d.$c[0];
        eregi("3|1|c",$d.$c[0])?die("nope"):NULL;
        strpos(($c[0].$d), "htctf2016")?$v3=1:NULL;
    }
}

</code>

$_GET['cat'],$_GET['dog'] Under what circumstances does $v3 equal 1?

Reply content:

<code>$v3 = 0;

$c=@$_GET['cat'];
$d=@$_GET['dog'];
if(@$c[1]){
    
    if(!strcmp($c[1],$d) && $c[1]!==$d){
        echo $d.$c[0];
        eregi("3|1|c",$d.$c[0])?die("nope"):NULL;
        strpos(($c[0].$d), "htctf2016")?$v3=1:NULL;
    }
}

</code>

$_GET['cat'],$_GET['dog'] Under what circumstances does $v3 equal 1?

This problem is caused by PHP's weak typing. The technique used here is that when strcmp compares array and string, a null will be returned, and %00 can truncate eregi.

Statement:
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn