dtn43447 2017-03-15 16:13
浏览 63

将动态(php)内容与静态内容(html)划分为网页设计的最佳方法?

Until this day I have been using notepad++ for website developing. my codes are like:

... 
<div><?php
$han=mysql_query("Blah blah ...");
$row=mysql_fetch_array($han);
// and so many codes to process text ..
echo $something;
?></div>
...

But maintenance of this kind of code is really hard. Now I see that everything is changing on webdesign. Everybody is going to make their websites responsive. I wish I could change my html code without seeing dynamic codes.

for example think I have have html file like this(static.html):

<div>#{content_here}</div>

and also a separate php file like this:

<?
$static_content=file_get_contents("static.html");
$han=mysql_query("Blah blah ...");
$row=mysql_fetch_array($han);
// and so many codes to process text ..
$content_here=$something;
echo str_replace("#{content_here}",$content_here,$static_content);
?>

This way I can separate static content from dynamic content. But this is all my innovation. And every time I invent something then I find that there is even a better and more extensive thing already invented.

So is there already IDEs that support this kind of web development? possibly get contents generated by php in json format and then blend it with Html content.

  • 写回答

0条回答 默认 最新

    报告相同问题?

    悬赏问题

    • ¥15 msix packaging tool打包问题
    • ¥28 微信小程序开发页面布局没问题,真机调试的时候页面布局就乱了
    • ¥15 python的qt5界面
    • ¥15 无线电能传输系统MATLAB仿真问题
    • ¥50 如何用脚本实现输入法的热键设置
    • ¥20 我想使用一些网络协议或者部分协议也行,主要想实现类似于traceroute的一定步长内的路由拓扑功能
    • ¥30 深度学习,前后端连接
    • ¥15 孟德尔随机化结果不一致
    • ¥15 apm2.8飞控罗盘bad health,加速度计校准失败
    • ¥15 求解O-S方程的特征值问题给出边界层布拉休斯平行流的中性曲线