English 中文(简体)
edit xml file (site-map) with php ! [复制]
原标题:edit xml file (site-map) with php ! [duplicate]
  • 时间:2009-11-21 13:50:00
  •  标签:
  • php
  • xml

我需要做一个文字,在我的网站(使用Sphp和Isql的分类工地)上安装一个新装置(供搜索引擎使用)。

我对如何使Xml站点地图自动化感到困惑。 每个站点地图最多可包含500万卢比的记录。

此外,每当用户删除其标语时(例如出售项目后),我需要该图里的URL,以便删除。

我已经有了一个从我的数据库BUT中生成Xml站点地图的文字,它将超越Xml站点地图,每当一个用户站立一个用户。

Is it even possible to edit an xml file with PHP at this level? For example, if I could read how many lines there are in an xml file, I would know where to set the limit (50000) and create a new one. Also, if I could read xml files and search for lines, I could also delete ads.

但这是可能的。

• 赞赏《刑法》 s或什么方法使用!

增 编

最佳回答

您可以简单地利用SimpleXML开放网站地图,然后做以下工作:

  1. Iterate the elements
  2. If you find the element, update it (url, last changed, etc.)
  3. If you dont find it append it.

当然,必须修改多个现场地图局势的界限。 此外,你还可以使用一些XPath搜索你的档案。 然而,通知说,从事这类XML工作可能相当缓慢。

因此,我认为,你应考虑定期重新绘制全部现场地图的可能性(每12小时或24小时),因为搜索引擎将非常少地绘制你的现场地图。

问题回答

考虑到每次添加/删除一个口号时都会增加或删除这一档案,我 stick着你现有的文字(从rat平中重建现场地图),并安排它每夜一次,即午夜。 由于搜索引擎每天赢得一次以上的现场地图,你赢得了失败。





相关问题
Brute-force/DoS prevention in PHP [closed]

I am trying to write a script to prevent brute-force login attempts in a website I m building. The logic goes something like this: User sends login information. Check if username and password is ...

please can anyone check this while loop and if condition

<?php $con=mysql_connect("localhost","mts","mts"); if(!con) { die( unable to connect . mysql_error()); } mysql_select_db("mts",$con); /* date_default_timezone_set ("Asia/Calcutta"); $date = ...

定值美元

如何确认来自正确来源的数字。

Generating a drop down list of timezones with PHP

Most sites need some way to show the dates on the site in the users preferred timezone. Below are two lists that I found and then one method using the built in PHP DateTime class in PHP 5. I need ...

Text as watermarking in PHP

I want to create text as a watermark for an image. the water mark should have the following properties front: Impact color: white opacity: 31% Font style: regular, bold Bevel and Emboss size: 30 ...

How does php cast boolean variables?

How does php cast boolean variables? I was trying to save a boolean value to an array: $result["Users"]["is_login"] = true; but when I use debug the is_login value is blank. and when I do ...

热门标签