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
Release: 2016-08-04 09:20:35
Original
1431 people have browsed it

<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>
Copy after login
Copy after login

$_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>
Copy after login
Copy after login

$_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.

Related labels:
php
source:php.cn
Statement of this Website
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
Popular Tutorials
More>
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template