Echo ' <? '; return empty

Source: Internet
Author: User
Echo ' The output is empty, considering that it may have been parsed by PHP
But what I want to do is to textare the PHP statement directly back to the results of PHP parsing
Can be implemented with Eval but cannot return any errors,

So I want to write a file, read the way to solve the file
Is there any good way to solve this?

if (empty ($_request)) {

$html = <<< EOF



Submit


EOF;
Echo $html;
}else{

$content = $_REQUEST['content']; $content = preg_replace('/;/',';',$content);// 分号容易犯错    $string  = addslashes($content);    // echo $string;    // echo '
'; if(eval($string) === false){ echo '输入错误'; }

}

Reply content:

Echo ' output is empty, considering that it may have been parsed by PHP
But what I want to do is to textare the PHP statement directly back to the results of PHP parsing
Can be implemented with Eval but cannot return any errors,

So I want to write a file, read the way to solve the file
Is there any good way to solve this?

if (empty ($_request)) {

$html = <<< EOF



Submit


EOF;
Echo $html;
}else{

$content = $_REQUEST['content']; $content = preg_replace('/;/',';',$content);// 分号容易犯错    $string  = addslashes($content);    // echo $string;    // echo '
'; if(eval($string) === false){ echo '输入错误'; }

}

Echo '

You want to output the contents of < > and other special symbols to the Web page, to be processed with the Htmlspecialchars function ... Not addslashes, Addslashes is used to deal with SQL filtering ...

  • 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.