Thread: eval remake
View Single Post
Old 04-21-2008, 06:13 AM   #2 (permalink)
sjaq
The Acquainted
 
sjaq's Avatar
 
Join Date: Nov 2007
Location: Netherlands
Posts: 113
Thanks: 11
sjaq is on a distinguished road
Default

PHP Code:
<?php 

    
function rep_eval($str) {
        
$f fopen('./tmp.php''w');
        
fwrite($f'<?php '$str ' ?>');
        
fclose($f);
        
        require 
'./tmp.php';
        
        
unlink('./tmp.php');
    }

    
rep_eval('
         $i = 0;
        for($v = $i;$v < 100;++$v){ 
           echo($v); 
        }
    '
);
    
?>
sjaq is offline  
Reply With Quote