后端开发|php教程
php,生成静态html
后端开发-php教程
上传通讯录源码,Vscode在哪里登录,ubuntu lts区别,服务异常监控tomcat,爬虫souutu,php正则匹配域名,seo权重重定向,织梦协会网站源码,博客制作模板下载lzw
<?php
/*
author:
done:生成html文档
date:-10-27
*/
require_once("conn.php");
if($_GET[all])
{
/*获取数据库记录,以便于生成html文件有个文件名*/
$sqlquery = "select * from $tbname";
$result = mysql_query($sqlquery,$conn)or die("查询失败!");
$fp = fopen("./template/article.html",r);
$fpcontent = fread($fp,filesize("./template/article.html"));
fclose($fp);
/*写入文件*/
while($row = mysql_fetch_array($result))
{
$fpcontent = str_replace("{thetitle}",$row[ itle],$fpcontent);
$fpcontent = str_replace("{chatitle}",$row[ itle],$fpcontent);
$fpcontent = str_replace("{bookcontent}",$row[content],$fpcontent);
$fp = fopen("./html/".$row[id].".html",w)or die("打开写入文件失败!");
fwrite($fp,$fpcontent)or die("写入文件失败!");
}
echo "alert(全部更新);";
}
if($_GET[part])
{
/*获取最后一条记录的ID,以便于生成html文件有个文件名*/
$sqlquery = "select * from $tbname order by id desc limit 1";
$result = mysql_query($sqlquery,$conn)or die("查询失败!");
$row = mysql_fetch_array($result);
$fp = fopen("./template/article.html",r);
$fpcontent = fread($fp,filesize("./template/article.html"));
fclose($fp);
$fpcontent = str_replace("{thetitle}",$row[ itle],$fpcontent);
$fpcontent = str_replace("{chatitle}",$row[ itle],$fpcontent);
$fpcontent = str_replace("{bookcontent}",$row[content],$fpcontent);
$fp = fopen("./html/".$row[id].".html",w)or die("打开写入文件失败!");
fwrite($fp,$fpcontent)or die("写入文件失败!");
echo "alert(部分更新成功!);";
}
?>
{
theform.submit();
}
<?
echo "全部更新
部分更新";
?>
diy图片编辑源码,vscode编辑提示,ubuntu后台运行窗口,iphone+tomcat,sqlite 标准差,帝国 商品评分插件注入,汽车前端框架 tier,学习爬虫代码软件,php 做什么,seo的方法有哪些,个人音乐网站源码报告,js网页效果代码,网上投票模板,个人资料页面代码,小米公司管理系统,vb科学计算器 源程序lzw