<?PHP
$dir=dir('./');
while($entry=$dir->read()){
if(!is_file($entry)) {continue;}
$handle=fopen($entry,"r");
while($buffer=fgets($handle,4096)){
$buffer=trim($buffer);
if(ereg("title*=*\"",$buffer)){
eval ($buffer);
$linknm=$title;
break;
}
}
}
?>
请问这个代码的eval()有什么问题?
怎么老是提示错误:Parse error: syntax error, unexpected '<' in D:\AppServ\www\navbar.inc(10) : eval()'d code on line 1
$dir=dir('./');
while($entry=$dir->read()){
if(!is_file($entry)) {continue;}
$handle=fopen($entry,"r");
while($buffer=fgets($handle,4096)){
$buffer=trim($buffer);
if(ereg("title*=*\"",$buffer)){
eval ($buffer);
$linknm=$title;
break;
}
}
}
?>
请问这个代码的eval()有什么问题?
怎么老是提示错误:Parse error: syntax error, unexpected '<' in D:\AppServ\www\navbar.inc(10) : eval()'d code on line 1
解决方案 »
- 【高手贴】给出一个RGB颜色,如何判断跟数据库里面的某一颜色接近?
- php 如何获取 远程内容
- 急!!!!mysql_select_db(): supplied argument is not a valid MySQL-Link resource
- 谁帮我看看我的相对路劲怎么错了,晕
- imagegif函数出问题
- [問題]PHP中fopen對文件操作,有錯誤提示,請解決下
- 送分啦,好简单的PHP函数问题,不拿白不拿了~~~
- mysql_query中如何同时执行多条sql语句?
- mysql中有函数取自动生成的字段值,SQlserver中怎么取呢?
- chr()???
- 这个数组怎么输出?
- 关于pcntl_fork
Evaluates the string given in code_str as PHP code. Among other things, this can be useful for storing code in a database text field for later execution. There are some factors to keep in mind when using eval(). Remember that the string passed must be valid PHP code, including things like terminating statements with a semicolon so the parser doesn't die on the line after the eval(), and properly escaping things in code_str . To mix HTML output and PHP code you can use a closing PHP tag to leave PHP mode. Also remember that variables given values under eval() will retain these values in the main script afterwards.