Note that there are some explanatory texts on larger screens.

plurals
  1. PORSS feed not validating because of substr cutting html characters
    text
    copied!<p>Currently unable to get my rss feed to validate through <a href="http://validator.w3.org/feed/check.cgi?url=http://www.mediwales.com/rss-events.php" rel="nofollow">W3C RSS Validator</a>. It seems there's a problem with the time/date. If you click the W3C link it'll show the errors. When I comment out the date it works fine but the date is kinda crucial!!</p> <p>Here's the original script: <pre><code> include "db.php"; header("Expires: 0"); header("Last-Modified: " . gmdate("D, d M Y H:i:s") . " GMT"); header("cache-control: no-store, no-cache, must-revalidate"); header("Pragma: no-cache"); header("Content-type: text/xml"); print "&lt;?xml version=\"1.0\" encoding=\"utf-8\" ?&gt;"; ?&gt; &lt;rss version="2.0"&gt; &lt;channel&gt; &lt;title&gt;MediWales Events&lt;/title&gt; &lt;description&gt;The latest Events, updates and announcements from MediWales.&lt;/description&gt; &lt;link&gt;http://www.mediwales.com&lt;/link&gt; &lt;copyright&gt;Copyright 2011 MediWales.&lt;/copyright&gt; &lt;docs&gt;http://blogs.law.harvard.edu/tech/rss&lt;/docs&gt; &lt;language&gt;en-us&lt;/language&gt; &lt;lastBuildDate&gt;&lt;? print date("D, d M Y H:i:s"); ?&gt; 0000&lt;/lastBuildDate&gt; &lt;managingEditor&gt;info@mediwales.com&lt;/managingEditor&gt; &lt;pubDate&gt;&lt;? print date("D, d M Y H:i:s"); ?&gt; 0000&lt;/pubDate&gt; &lt;webMaster&gt;info@mediwales.com&lt;/webMaster&gt; &lt;generator&gt;codeworks rss script (1.0.0)&lt;/generator&gt; &lt;image&gt; &lt;url&gt;http://mediwales.com/login/uploaded/template/logo.png&lt;/url&gt; &lt;title&gt;MediWales Website&lt;/title&gt; &lt;link&gt;http://www.mediwales.com&lt;/link&gt; &lt;description&gt;The latest Events, updates and announcements from MediWales.&lt;/description&gt; &lt;width&gt;144&lt;/width&gt; &lt;height&gt;52&lt;/height&gt; &lt;/image&gt; &lt;? $latestnews = mysql_query("SELECT myevents.*, myevents_dates.datefrom from myevents, myevents_dates WHERE myevents_dates.datefrom &gt;= CURDATE() AND myevents.id = myevents_dates.eventid order by myevents_dates.datefrom"); while ($news = mysql_fetch_assoc($latestnews)) { $datetime = explode(" ",$news[datefrom]); $date = explode("-",$datetime[0]); $time = explode(":",$datetime[1]); $news[description] = strip_tags($news[description]); $news[description] = htmlspecialchars($news[description]); echo "&lt;item&gt;"; echo "&lt;title&gt;".mb_convert_encoding(htmlspecialchars($news[title]),"US-ASCII")."&lt;/title&gt;"; echo "&lt;description&gt;".mb_convert_encoding(substr($news[description],0, 250),"US-ASCII")."&lt;/description&gt;"; echo "&lt;link&gt;http://www.mediwales.com/index.php?id=4&amp;amp;nid=$news[id]&lt;/link&gt;"; echo "&lt;pubDate&gt;".date('D, d M Y H:i:s O', mktime($time[0],$time[1],$time[2],$date[1],$date[2],$date[0]))."&lt;/pubDate&gt;"; echo "&lt;/item&gt;"; } ?&gt; &lt;/channel&gt; &lt;/rss&gt; </code></pre>
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload