if(isset($_GET['w'])&&$_GET['w']>=0&&$_GET['w']<=65)
when $_GET['w'] has a value of (for example) ccc the condition becomes true whereas it should only accepts numbers from and including 0 to and including 65
Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.
Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.
Lost your password? Please enter your email address. You will receive a link and will create a new password via email.
Please briefly explain why you feel this question should be reported.
Please briefly explain why you feel this answer should be reported.
Please briefly explain why you feel this user should be reported.
“ccc” == 0 is true.
You should also check whether it is a number before comparing $_GET[…] parameters this way.
isnumeric() if I’m correct.
There are other tests you can use to check whether it’s a decimal number. For example, you could run a
preg_match('/^[0-9]+$/', $_GET['w']) == 1.