最新下载
热门教程
- 1
- 2
- 3
- 4
- 5
- 6
- 7
- 8
- 9
- 10
php 生成符合google 地图标准xml类sitemap代码
时间:2010-04-19 编辑:简简单单 来源:一聚教程网
mysql教程_connect("localhost","root","root") or die('Database Server Uid or Password Error!');
mysql_select_db('ip') or die('data !');
mysql_query("SET NAMES 'gb2312'");
*/
include("boke/inc/re_conn.php");
$file = 'update.xml';
$url = '
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://www.sitemaps.org/schemas/sitemap/0.9
http://www.sitemaps.org/schemas/sitemap/0.9/sitemap.xsd">';
$sql = "Select * from filecontent order by id desc limit 0,100 ";
$query = mysql_query( $sql );
while( $rs = mysql_fetch_array( $query ) )
{
$time = filemtime(substr($rs['s_url'],1));
$s = date("Y-m-d",$time);
$s1 = date("H:i:s+00:00",$time);
$s = $s.'T'.$s1;
$url .= "
}
if( $url )
{
$url .="";
null_write($url);
echo '生成网站地图成功查看';
}
function null_write($new)
{
global $file;
$f=fopen($file,"w");
flock($f,LOCK_EX);
fputs($f,$new);
fclose($f);
}
-
上一个: php最简单的生成xml文档实例教程
-
下一个: google地图 标记地图代码
相关文章
- PHP导出数据超时的优化建议解读 10-31
- PHP之mysql位运算解析 10-31
- Laravel实现登录跳转功能解析 10-31
- php双向队列解读 10-31
- Laravel异常上下文解决教程 10-24
- php数组查询元素位置方法介绍 10-24