PHP is not a small number of parts are divided into. 3 is not a vulnerability solution

Source: Internet
Author: User
PHP is not a small number of parts divided into. 3 Is there a loophole?
To get a value from an HTML page, the database reads a value, judging if they're not equal to doing something (! =) when the fractional portion of the two numbers is. 3 o'clock actually judging the error;
For example, two numbers are 54.3 or 55.3 it actually determines that true should be false, the fractional part is other when there is no problem, such as 54.2
Did you ever come across it?

------Solution--------------------
No problem ... Landlord your code has a problem or the brain short-circuited it.
PHP code
var_dump (54.3! = 55.3);//bool (true) 
------ Solution--------------------
Multiple tests, no problem found
------solution--------------------
PHP code
 '; Echo ' $ Var[\ ' peilv\ ': ', $var [' Peilv '], ' $tempCurPeilv: ', $tempCurPeilv; Var_dump ($var [' peilv ']! = $TEMPCURPEILV); 
------Solution--------------------
April Fools ' day haha
PHP code
boolean Trueboolean false$var[' Peilv ']:55.3$tempcurpeilv:55.3boolean false 
------Solution--------------------
because your comparison becomes a string and a floating-point number or other type of comparison, the result is the exception you said.
  • Related Article

    Contact Us

    The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

    If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

    A Free Trial That Lets You Build Big!

    Start building with 50+ products and up to 12 months usage for Elastic Compute Service

    • Sales Support

      1 on 1 presale consultation

    • After-Sales Support

      24/7 Technical Support 6 Free Tickets per Quarter Faster Response

    • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.