473,395 Members | 1,975 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,395 software developers and data experts.

How come my RSS feed doesn't always load?

I am having trouble with my RSS script. It loads correctly in Safari, it is displayed as text in Chrome, it doesn't load in Internet Explorer, and it load every 3 or 4 refreshes in Firefox... it is very strange. Here is my code, it loads the data from a sql database. You can see the live page here: http://www.eventvt.com/rss.php

Expand|Select|Wrap|Line Numbers
  1. <?php
  2.  
  3. mysql_connect(DB_HOST, DB_USER, DB_PASS) or die(mysql_error());
  4. mysql_select_db(DB_NAME) or die(mysql_error());
  5.  
  6. $sql = "SELECT id, title, text FROM TABLE order by id desc limit 15";
  7. $result = mysql_query($sql) or die(mysql_error());
  8. //$row = mysql_fetch_array($result);
  9.  
  10.  
  11. while ($line = mysql_fetch_assoc($result))
  12.         {
  13.             $return[] = $line;
  14.         }
  15.  
  16. $now = date("D, d M Y H:i:s T");
  17.  
  18. $output = "<?xml version=\"1.0\"?>
  19.             <rss version=\"2.0\">
  20.                 <channel>
  21.                     <title>eventVT RSS</title>
  22.                     <link>http://www.eventvt.com/rss.php</link>
  23.                     <description>New events in the Vermont area</description>
  24.                     <language>en-us</language>
  25.                     <pubDate>$now</pubDate>
  26.                     <lastBuildDate>$now</lastBuildDate>
  27.                     <docs>http://www.eventvt.com</docs>
  28.                     <managingEditor>eventvt@gmail.com</managingEditor>
  29.                     <webMaster>eventvt@gmail.com</webMaster>
  30.             ";
  31.  
  32. foreach ($return as $line)
  33. {
  34.     $output .= "<item><title>".htmlentities($line['title'])."</title>
  35.                     <link>http://www.eventvt.com/eventdisplay.php?id=".htmlentities($line['id'])."</link>
  36.  
  37. <description>".htmlentities(stripslashes($line['text']))."</description>
  38.                 </item>";
  39. }
  40. $output .= "</channel></rss>";
  41. header("Content-Type: application/rss+xml");
  42. echo $output;
  43. ?>
  44.  
May 3 '11 #1
0 1069

Sign in to post your reply or Sign up for a free account.

Similar topics

6
by: alan | last post by:
Dear all, I have a servlet problem. When I modified my java servlet program and then uploaded it to my web hosting server, then I start my web browser(I.E) to see the result. But it loaded...
4
by: Bob Bedford | last post by:
We have no access to a mysql NG on my provider's server, so we ask here: We have a long query (long in text) with a UNION between 2 select. We have been informed that some times the query...
14
by: g | last post by:
http://mysite.verizon.net/gdguarino/montauk.htm You can also click on the other pages of the site if the problem doesn't show itself on this page. I'm using two stylesheets for each page, one...
3
by: Phil Galey | last post by:
I have a VB.NET application that uses SendKeys to close the open document in QuarkXPress 5.0 I'm using the following commands: AppActivate(QXP_Process_ID) SendKeys.SendWait("^{F4}") in an...
7
by: gmax2006 | last post by:
Hi, I use RedHat linux. How can I find where exactly the current python script is running? I use this code: #test.py import os,sys
2
by: Jason | last post by:
Hello everyone, I have a chatroom. If someone leaves, I need to tell the server that person has left. Currently i catch window.onbeforeunload to check if the person tries to leave. I noticed that...
1
by: brett | last post by:
I have a user control with a namespace similar to: mysite.SomeApp.TheControl In an aspx page, I'd like to load the above control based on its filename. The page is in the same namespace,...
3
by: annoula | last post by:
Hello, I'm sorry if this has come up before but I haven't been able to find a solution in any forum so far. I have a page with 2 forms. One form contains links that the user clicks to navigate...
0
by: neverMind | last post by:
Hi there, I have an assignment to invert a ppm image, with a header of 4 lines (P6\nwidth\nheight\ndepth\n),and we have to do a shared memory version and a memory mapped file (MMF) too. This...
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
0
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.