>SmartCalc.exe_

<html>
<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <meta http-equiv="X-UA-Compatible" content="ie=edge">
    <title>MyApp Home</title>
    <link rel="stylesheet" href="style.css">
</head>
<body>
    <div class="column">
        <h1>>SmartCalc.exe_</h1>
        
        <?php

        ini_set
('display_errors','On');
        
ini_set('error_reporting','E_ALL');
        
error_reporting(E_ALL);
        if(isset(
$_GET['debug'])) die(highlight_file(__FILE__));

        
$whitelist_numbers =  range(1,1000);
        
$whitelist_ops = array("+","-","*","/");

        
$param1 $_GET['p1'];
        
$param2 $_GET['p2'];
        
$operator $_GET['op'];
        

        if( 
in_array($param1$whitelist_numbers) && in_array($param2$whitelist_numbers) && in_array($operator$whitelist_ops) ){
            
$exec "${param1} ${operator} ${param2}";
            
$evalcode "return $exec;";

            echo 
"<details><summary>DEBUG</summary>";
            echo 
"PHP sẽ thực thi eval code sau đây:";
            echo 
"<pre>$evalcode</pre>";
            echo 
"</details><br>";
            
            
// Nếu chưa biết về eval có thể đọc ở đây: https://php.net/eval
            
echo $exec " = ". eval($evalcode);
        } else {
            echo 
"Not supported";
        }

        
?>
    </pre>
    <p>👉 <a href="?p1=191&p2=7&op=*">example</a><br>🤖 <a href="?debug">source</a></p>
</div>
</body>
1