This article is a mirror article of machine translation, please click here to jump to the original article.

View: 13110|Reply: 1

[Webmaster Communication] discuz runs PHP statements in the template via {eval }

[Copy link]
Posted on 4/1/2017 2:28:22 PM | | |

In the past few days, I have been writing discuz tutorials in the development of discuz, and I am also a bird, and I also share things that I don't know during the development process, so that everyone can avoid detours.
Today I will tell you how to run php syntax in the discuz template and get php results.
It's also very simple, because I don't know much about discuz, but I used to be very proficient in supesite.
The method of running a PHP statement in a template via discuz via {eval } is as follows:

<!--{eval $my_var = 1;}-->
<!--{eval echo $my_var;}-->
<!--{eval $my_arr = array(1, 2, 3);}-->
<!--{eval print_r($my_arr);}-->
<!--{eval output();}-->
<!--{eval exit();}-->

So we can run PHP syntax, discuz is powerful, and now we can understand it!




Previous:Newcomer reports
Next:sql creates a remote link server
Disclaimer:
All software, programming materials or articles published by Code Farmer Network are only for learning and research purposes; The above content shall not be used for commercial or illegal purposes, otherwise, users shall bear all consequences. The information on this site comes from the Internet, and copyright disputes have nothing to do with this site. You must completely delete the above content from your computer within 24 hours of downloading. If you like the program, please support genuine software, purchase registration, and get better genuine services. If there is any infringement, please contact us by email.

Mail To:help@itsvse.com