KevinM1 Posted October 13, 2006 Share Posted October 13, 2006 I have a script that creates an RSS feed for one of the sites I have. It was working fine, but now it's parsing the info wrong and I'm not sure why. All it's supposed to do is return a message board post. Below is the code that creates the link:[code]<?php //just to turn on the pretty colors<link>".$base."forum/viewthread.php?".$rstart."forum_id=".$row['forum_id']."&thread_id=".$row['thread_id']."#post_".$row['post_id']."</link>\n?>[/code]The problem lies at the forum_id - & segment of the code. Instead of returning something like:website.com/forum/viewthread.php?rowstart=20[b]forum_id[/b]=4[b]&[/b]thread_id=25#post_66I get:website.com/forum/viewthread.php?rowstart=20=4thread_id=25#post_66Any ideas on why this is screwing up? And I haven't changed the code in months, so it's not as though I screwed it up by tweaking it myself. Quote Link to comment https://forums.phpfreaks.com/topic/23856-rss-help/ Share on other sites More sharing options...
dymon Posted October 13, 2006 Share Posted October 13, 2006 Could you please write what the variable $rstart shows. And why there is no & before "forum_id="? Quote Link to comment https://forums.phpfreaks.com/topic/23856-rss-help/#findComment-108382 Share on other sites More sharing options...
KevinM1 Posted October 13, 2006 Author Share Posted October 13, 2006 The $rstart variable is fine...all it does is specify which table row to start on for pagination.I put an ampersand before the forum_id, but I'm not sure if it worked yet. I use Google for reading my feeds, and sometimes it takes a while for any changes to become apparent. Quote Link to comment https://forums.phpfreaks.com/topic/23856-rss-help/#findComment-108425 Share on other sites More sharing options...
KevinM1 Posted October 13, 2006 Author Share Posted October 13, 2006 Should I be using htmlspecialchars_decode for the ampersand? Or will it print correctly because it's within double-quotes? Quote Link to comment https://forums.phpfreaks.com/topic/23856-rss-help/#findComment-108452 Share on other sites More sharing options...
Daniel0 Posted October 13, 2006 Share Posted October 13, 2006 Try reading the tutorial [url=http://www.phpfreaks.com/tutorials/139/0.php]Creating dynamic RSS feeds[/url] :)It should help you with creating a dynamic RSS feed. Quote Link to comment https://forums.phpfreaks.com/topic/23856-rss-help/#findComment-108485 Share on other sites More sharing options...
KevinM1 Posted October 13, 2006 Author Share Posted October 13, 2006 I fixed it. My problem wasn't with creating the feed. The feed came as part of PHP-Fusion. The problem came from the pre-existing code using & instead of its HTML entity equivalent whenever the post appeared on any page but the first. My original tweak (swapping & for its entity), months ago, worked on posts that were on the first page so I thought it would work for all posts, and I didn't notice that $rstart would contain the &. Oops. :blush: Quote Link to comment https://forums.phpfreaks.com/topic/23856-rss-help/#findComment-108498 Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.