Question: This is a strange question .. PHPcode & lt ;? Phprequire_once (magpierssrss_fetch.inc); $ url & quot; localhostPHPProjectRSSRSS. xml & quot; $ rssfetch_r: this is a strange question .. Basic RSS applications
PHP code
channel['title']; echo 'Latest News from ' . $feedTitle . '
'; foreach ($rss->item as $it) { $link = $it['link']; $title = $it['title']; $description = isset($it['description']) ? $it['description'] : ''; echo '' . $title . '
' . $description . '
'; }?>
XML:
(Http: // localhost/PHPProject/RSS. xml)
XML code
-
-
XHTML
http://localhost/PHPProject/NewFile.html
Free web building tutorials
Web development
en-US
2006 w3school.com.cn. All rights reserved.
-
RSS Tutorial
http://localhost/PHPProject/NewFile.html
New RSS tutorial on W3School
service@w3school.com.cn
http://localhost/PHPProject/NewFile.html
1.
Why is it displayed as follows:
Latest News from W3School Home Page
RSS Tutorial
New RSS tutorial on W3School
After clicking RSS Tutorial, HTTP 403 is displayed?
2.
In the foreach ($ rss-> item as $ it) of PHP, why do you have to set items to run successfully? otherwise
Latest News from W3School Home Page
Notice: Undefined property: MagpieRSS ::$ item in D: \ Apache Group \ Apache2 \ htdocs \ PHPProject \ index5.php on line 10
Warning: Invalid argument supplied for foreach () in D: \ Apache Group \ Apache2 \ htdocs \ PHPProject \ index5.php on line 10
But in my XML Inside is Rather Oh ....
3.
Before I modify the XML file In It is "W3School Home Page", so it is displayed as Latest News from W3School Home Page at runtime. However, after modification, it is shown as above <title> XHTMLWhy is Latest News from W3School Home Page displayed after refresh?
Even if you restart zend studio, Latest News from W3School Home Page is displayed .... It's not about caching .. I have cleared the cache.
Please help .. I have sharded
------ Solution --------------------
1. your code has a problem:
Echo'
'. $ Title .'
'. $ Description .'
';
Because $ link is enclosed in single quotes, it will not be parsed. So the link is the link on this page $ link
As for why 403 has no permission, it depends on your server settings.
2. RSS standards:
A channel may contain any number S.
XML code
...
...
...
------ Solution --------------------
Discussion
Reference:
How did you modify it. As follows:
Echo"
$ Title
$ Description
";
Isn't that okay ??
Echo'
'. $ Title .'
'. $ Description .'
';
Not to say ......