vispārīgi runājot, ir 2 lietas, cik sapratu no php eval() apraksta (neesmu php lietojis pāris gadus, varbūt neatceros, tālāk meklēt pašam slinkums):
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.
Tas nozīmē, ka eval() normāli apstrādās tikai valīdu PHP vai HTML, kas SEKO aizverošam PHP tagam; piemēram, šie būs pareizi $content_big saturi:
1) echo "BOO";
2) echo "BOO"; ?>
3) ?>
//iespējams (3) vajag vēl ";" pirms "?>"
Bet šie nebūs:
1) echo "BOO" // trūkst beigu semikola
2) // nav valīda PHP!
Tā lūk. Tā kā ja ir pliks HTML un pliks PHP kaut kur tur maisīti, tad nederēs.
(Lasīt komentārus)
Nopūsties: