New question: This is too weird about the problem. Basic Application of RSS

Source: Internet
Author: User
New question: This is too weird. Basic Application of RSS
PHP Code
  
   
  
   channel[' title '];    Echo '

' . $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/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 does the run appear as:
Latest News from W3school Home Page

RSS Tutorial
New RSS tutorial on W3school

After clicking on RSS tutorial, it shows HTTP 403?




2.
The item in the foreach ($rss->item as $it) in PHP has no reason 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, Within is Rather than Oh....




3.
I modified the XML file before the In the <title>Is "W3school home page", so the runtime is displayed as latest News from W3school home page, but the changes are as shown above <title>xhtml</title>Why is the latest News from W3school Home Page displayed after the refresh?

Even if restarting the entire Zend Studio continues to show latest News from W3school Home Page, I don't understand .... It's not about the cache. I've cleared the cache.


Would you please help me? I still have a split.

------Solution--------------------
1. There is a problem with your code:
Echo '

' . $title. '
' . $description. '

';
The $link is not parsed because it is within single quotation marks. So the link is this page link $link
As for why 403 does not have permission to look at your server settings.

2. The RSS standard stipulates that: A Channel may contain any number of s.
XML Code
  
       
        
        ...     
   
        
         
    ...
   
             
   
        
         
    ...
   
             
   
        
  
       
------Solution--------------------
Explore

Reference:

How did you change that? Here's how it goes:
echo "

$title
$description

";


Isn't this okay??

Echo '

' . $title. '
' . $description. '

';

It's not that ...
  • Related Article

    Contact Us

    The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

    If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

    A Free Trial That Lets You Build Big!

    Start building with 50+ products and up to 12 months usage for Elastic Compute Service

    • Sales Support

      1 on 1 presale consultation

    • After-Sales Support

      24/7 Technical Support 6 Free Tickets per Quarter Faster Response

    • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.