Currently I am working on a project in which I have to save some PHP code
in database, I am saving the code with PHP tags
.
But I am not getting how I can retrieve the code exactly as stored into database.
I have tried the following methods :
a) Direct retrieval : When I am retrieving the databse directly then the value of $row['code'] is blank
b) using eval() : When I am using eval() then I am getting syntax error :
syntax error, unexpected '<' in H:\xampp\htdocs\trycodeonline\testing.php(27) : eval()'d code on line 1
c) using eval() without php tags : when I am removing the php codes then I am getting result instead of code, like I want to print echo "hello"
but it is printing "hello"
So how can I print the php code ?