can anyone help me to solve my query? I want to execute php unlink command which is store in DB. For example:
?php echo eval("?>".unlink('abc.txt')."<?") ?>
Please
?>
is a closing PHP tag, and <?
is a short open PHP tag, so at a minimum, you have those backwards.
In your code, you don't need these PHP tags at all. They are meant for the parser, not for eval()
, which is already in PHP mode.
The best thing to do is not store this sort of thing in your database. I can't think of a single reason why you would put PHP code in your database values. You should instead have that file name, and then run a for
loop over the results to unlink
.
Basically, your entire solution is broken. You can start by removing those backwards PHP tags and it will work... but is that really what you want? Probably not.