Hello friends, is there a way to insert PHP code into Wordpress text widgets? Please tell me how to do it.
Hello friends, is there a way to insert PHP code into Wordpress text widgets? Please tell me how to do it.
My guess is no. Wordpress is based on PHP, but it probably doesn't allow PHP code within something that is used inside it-- that would likely require using eval() which is a potential security risk.
In theory, it's possible for wordpress to do this-- but I don't think it does.
Have you checked the manual/support site for this?
Daniel - Freelance Web Design | <?php?> | <html>| español | Deutsch | italiano | português | català | un peu de français | some knowledge of several other languages: I can sometimes help translate here on DD | Linguistics Forum
Brainsmith, do you mean like this -
http://wordpress.org/extend/plugins/php-code-widget/
?
Edit -
Read traq's post and don't use this![]()
Last edited by keyboard; 12-04-2012 at 06:08 AM.
Just FYI, this falls into the incredibly stupid category.
Makes things really easy to hack.Originally Posted by execphp.php [line 42]
Even easier to mess things up accidentally, all by yourself.
This "useful widget" ignores both of those warnings. It takes unfiltered user input and treats it like trusted PHP code.Originally Posted by php.net
It is a very serious security risk.
If you don't believe me, ask around.
You do not want to "execute arbitrary PHP code."
Last edited by traq; 12-04-2012 at 06:07 AM.
Bookmarks