1. Advertising
    y u no do it?

    Advertising (learn more)

    Advertise virtually anything here, with CPM banner ads, CPM email ads and CPC contextual links. You can target relevant areas of the site and show ads based on geographical location of the user if you wish.

    Starts at just $1 per CPM or $0.10 per CPC.

Help with php rss feed please

Discussion in 'PHP' started by egdcltd, Aug 4, 2005.

Thread Status:
Not open for further replies.
  1. #1
    Okay, I've created the following rss feed for my site, but I've obviously done something wrong because I keep getting a 500 Server Configuration Error

    <?
    header('Content-type: text/xml'); 
    	include("PATH TO DATABASE CONNECTION FILE");
    	mysql_select_db($database_conn, $conn);
    ?>
    
    <rss version="2.0">
    <channel>
    <title>DirectoryGold Article Directory</title>
    <description>Get free content for your website or submit your article for free</description>
    <link>http://www.directorygold.com/more/article/</link>
    <copyright>Copyright eGDC Ltd 2004-5</copyright>
    
    <?
    $getItems="SELECT id,title,name,UNIX_TIMESTAMP(dtcreated) AS dtcreated
    FROM articles LIMIT 0,8 ORDER BY dtcreated DESC";
    $doGet=mysql_query($getItems);
    
    while($item=mysql_fetch_array($doGet))
     {
      $id=$doGet['id'];
      $title=strip_tags($doGet['title']);
      $body=strip_tags($doGet['name']);
    <!-- $body=substr($doGet['content'],0,150)); -->
      $pubDate=strftime("%a, %d %b %Y %T %Z",$doGet['dtcreated']);
    
      // output to client
    	
    ?>
    
      <item>
      <title><?print htmlentities($title,'ENT_QUOTES');?></title>
      <description><?print htmlentities($body,'ENT_QUOTES');?></description>
      <link>http://www.directorygold.com/more/article/article_<?print $id;?></link> 
      <pubDate><?print $pubDate;?></pubDate>
      </item>
    
    <? 
      } 
    ?>
    
    </channel>
    </rss>
    
    Code (markup):
    I've removed the path to the database connection file as I don't want to publish its' location in a public forum.
    SEMrush
    Can anyone tell me what I've done wrong please?
     
    egdcltd, Aug 4, 2005 IP
    SEMrush
Thread Status:
Not open for further replies.