您好,欢迎访问一九零五行业门户网

echo '<?'; 返回空

echo '';
输出为空,考虑到可能是被php 解析了
但是我想实现的是textare 中 输入php 语句 直接返回 php 解析后的结果
用 eval 可以实现 但是 不能返回什么错误,
所以想通过写文件,读文件的方式来解决
有什么好的解决方式吗
if(empty($_request)){
$html =

提交
$(#button).click( function(){ $(#eval).load('',{content:$(#content).val()}); });//ctrl +回车function ctlsubmit(event) { if (event.ctrlkey && event.keycode == 13) { $(#button).click() }}

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

}
回复内容: echo '';
输出为空,考虑到可能是被php 解析了
但是我想实现的是textare 中 输入php 语句 直接返回 php 解析后的结果
用 eval 可以实现 但是 不能返回什么错误,
所以想通过写文件,读文件的方式来解决
有什么好的解决方式吗
if(empty($_request)){
$html =

提交
$(#button).click( function(){ $(#eval).load('',{content:$(#content).val()}); });//ctrl +回车function ctlsubmit(event) { if (event.ctrlkey && event.keycode == 13) { $(#button).click() }}

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

}
echo ''; 返回空 不是被php解析了 是被当成 html 标记了,你查看网页源代码看看……
你要输出带有 等特殊符号的内容到网页上,要用 htmlspecialchars 函数进行处理的呀 …… 不是 addslashes , addslashes 是用来处理 sql 过滤的……
其它类似信息

推荐信息