English 中文(简体)
动态地利用实验室制作地图xml
原标题:dynamically create sitemap xml using php

我在以下链接中用一些参考法为我的现场绘制了现场地图:

制作带有PHP的XML网站地图

但是,我错了。

XML Parsing Error: undefined entity Location:

我的内容如下:

<< alt >>compgt;属性,如:

http://www.example.com/700-“rel=“nofollow noreferer” http://www.example.com/700-。 & laquo;alt & raquo;-attributes-in-images.php< /loc >

任何人都能够告诉我如何消除这一错误。

问题回答

我认为,你只得使用<代码>urlencode(>)在使用<代码>html_entity_decode(之前就链接价值的功能,并重新调整这些实体:

echo  <loc> .urlencode(html_entity_decode($link)). <loc> ;

或您的法典中类似内容。

最好的解决办法是接触你的根切,并添加到您的阿帕奇图中。 a. 提交以下文件:

RewriteEngine On
RewriteRule sitemap.xml sitemap.php [L]

而后又只有文件sitemap.php。 因此,在您的根本中,通常可以通过<代码>http://yoursite.com/sitemap.xml,即所有搜索引擎将首先搜索的违约URL。

The file sitemap.php 开始

<?php header( Content-type: application/xml; charset=utf-8 ) ?>
<?php echo  <?xml version="1.0" encoding="UTF-8"?>  ?>

我有这种解决办法,它像一个药店一样:





相关问题
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 ...

热门标签