On Fri, May 14, 2010 at 1:14 PM, Alice Wei <aj...@alumni.iu.edu> wrote:
> Hi,
>   You are right about the fact I am not having multiple documents, and yet 
> what I am trying to do here is to have one xmldoc, which I have declared in 
> my original email, and have my other rss feeds that I am trying to call from 
> the PHP to append as I check more checkboxes from the list.
>   Right now, when I check one box, it does present it the way I want it, 
> which is open a new xmldoc, and print out the rss feed. Yet, when I try to 
> check the second box, it gives me the display of the rss feed from the second 
> and not the first, because the second one opens a new xmldoc. However, I 
> would like to see both docs in one screen, which is why I want to know if 
> there is such a function available.
>   Is what I am trying to do here possibly by any chance?
>   Thanks for your help.
> Alice

Just move all of your DOMDocument code block inside the loop after the switch.


$q2 = explode(" ",$q);
$count = count($q2);

for($i=0;$i<$count;$i++) {

    //find out which feed was selected
    switch ($q2[$i]) {
       case "Weather":

       case "NFL":
         $xml = ("http://www.nfl.com/rss/rsslanding?searchString=home";);


    $xmlDoc = new DOMDocument();

    //get and output "<item>" elements
    for ($i=0; $i<=4; $i++)

        echo ("<p><a href='" . $item_link . "'>" . $item_title . "</a>");
        echo ("<br />");
        echo ($item_desc . "</p>");




PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php

Reply via email to