splitting an xml feed up in several pages using php

Discussion in 'PHP' started by smetten, Apr 21, 2008.

  1. #1
    hi there

    currently im trying to adjust this code to show only 10 results per page. I can t seem to find any piece of php code that does this, can somebody help me with this please?

    I want to split up the xml feed and show the no of pages (each page with 10 results on them) on the bottom.

    I currently use the code below (sample)

    <?php // Load and parse the XML document 
    $rss =  simplexml_load_file('http://api.indeed.com/apisearch?key=17a05830c4a0eb769feb73cfc499050d&q=&l=Wisconsin&sort=date&start=10&limit=100&fromage300=&filter=&latlong=1');
    $title =  $rss->channel->title;
    ?>
    <html xml:lang="en" lang="en">
    <head>
      <title><?php echo $item; ?></title>
    </head>
    <body bgcolor=white link=blue text=black>
    
    <h1><?php echo $item; ?></h1>
    
    <?php
    // Here we'll put a loop to include each item's title and description
    foreach ($rss->results->result as $item) 
    {
      echo "<table width=40%><tr><h2><font color=red></font color>&nbsp;&nbsp;<a href='" . $item->url . "'>" . $item->jobtitle . "</a></h2>";
      echo "<p> <font color=red></font color>&nbsp;&nbsp;<font size=1><font color=red>" . $item->date . "</font color></font size></p>";
      echo "<p> <font color=red></font color>&nbsp;&nbsp;" . $item->company . "</p>";
      echo "<p> <font color=red></font color>&nbsp;&nbsp;" . $item->city . "</p>";
      echo "<p> <font color=red></font color>&nbsp;&nbsp;" . $item->snippet . "</p></table><br><br>";
      }
    ?>
    </body>
    </html>
    
    PHP:
     
    smetten, Apr 21, 2008 IP
  2. smetten

    smetten Active Member

    Messages:
    269
    Likes Received:
    4
    Best Answers:
    0
    Trophy Points:
    58
    #2
    Is it possible to use pagination on this page page

    It´s an XML feed from indeed.com (done in php5 - view first post) - it has like 100 results, is it possible to split it up in 10 pages with 10 results each?

    it seems to work on JJim Karter´s site (also xml feed from indeed.com) working example

    Or can´t this be done? I can´t seem to find any info on this.

    Greetz

    Nick
     
    smetten, Apr 22, 2008 IP
  3. smetten

    smetten Active Member

    Messages:
    269
    Likes Received:
    4
    Best Answers:
    0
    Trophy Points:
    58
    #3
    Noone can help?
     
    smetten, Apr 22, 2008 IP