Forum Moderators: coopster
I have an RSS reader script ready to work and here is what I would like to do. The script needs an RSS feed URL to display the items in an html page:
I managed to have the search query written in the web page with the get function from the search form:
$query = $_GET["query"]; For the script, I need to enter the query inside the RSS feed URL
$RSSfeedurl = "http://mydomain.com/rss.php?query=KEYWORD"; $RSSfeedurl = "http://mydomain.com/rss.php?query=$query"; the query is not read. Does anyone know the correct way to do this? I am not English and don't know much about php so I hope you understand what I mean. :)
I will repeat to be sure I understood
if you edit this url
$RSSfeedurl = "http://mydomain.com/rss.php?query=KEYWORD";
manually then that line works but if you add the variable it doesn't?
seems odd, makes me think of two things, first is to concatenate your var properly and not rely on "
$RSSfeedurl = "http://mydomain.com/rss.php?query=" . $query;
not that we will see a difference now but, hey, you never know.
the other thing would be to spit out what's in $query to make sure it is correct, or even echo the whole url, maybe this
echo '<p>query: ',$query;
$RSSfeedurl = "http://mydomain.com/rss.php?query=" . $query;
echo '<p>RSSfeedurl: ',$RSSfeedurl;
then you can have a look
$RSSfeedurl = "http://mydomain.com/rss.php?query=$query;"; $RSSfeedurl = "http://mydomain.com/rss.php?query=$query"; $keywords = ereg_replace(' ', '+', $query ); $RSSfeedurl = "http://mydomain.com/rss.php?query=$keywords"; Now my first script is out of beta and I am very happy :)
Thank you again for your help ;)