摘要
在传统的CGI程序编写中,用printf()函数产生HTML源代码,这样的CGI程序代码冗长,不利于阅读,且容易出错。针对这一问题,提出仿"ASP"技术的解决方法,即预先将需要显示的网页保存成文件,并设计配置文件将需要动态显示的内容进行替换。实验表明,该方法可显著减少CGI程序代码量,且便于修改升级。另外通过修改Web服务器Boa的源代码,对文件路径进行隐藏,增加了系统的安全性。
Traditional CGI programming with a simple printf function to generate the HTML source code,such lengthy CGI code is not conducive to reading and error-prone.A solution similar to ASP technique is propesed,saving the pages to display as documents,and designing configuration file to replace dynamically displayed contents.The experiment results testify that this approach can significantly reduce the volume of CGI code,and can easily modify it.In addition,this system can hide the file path by modifying the source code of the web server Boa,and this method can increase its security.
出处
《现代电子技术》
2009年第18期55-58,共4页
Modern Electronics Technique