seblondres Posted June 2, 2014 Share Posted June 2, 2014 Hi Everyone, I’m currently using the indeed API to retrieve jobs. Users can either use the search box or click on some hyperlinks e.g. Java Developer. If they click on a hyperlink, I’m using &GET to pick up the keywords from the URL to query Indeed e.g. www.sitename.com/index.php?job=java in this case the page will display all the jobs that contain the keyword java. Now the indeed API is limited to 25 jobs per request, but they have a parameter call “start” that can be added at the end of the URL above to call more jobs e.g. www.sitename.com/index.php?job=java&start=10 will call the next 10 jobs. So I’m trying to figure out, how I could add a next / previous link at the bottom of the pages that will add that piece of code &start=10, &start=20 etc. in the URL so users can call more jobs, any idea? Thanks for your help, Seb Link to comment Share on other sites More sharing options...
justsomeguy Posted June 2, 2014 Share Posted June 2, 2014 What code are you using so far? If you have a way to get the total number of results then you can use pagination, there are many examples of pagination online. Link to comment Share on other sites More sharing options...
seblondres Posted June 3, 2014 Author Share Posted June 3, 2014 Many thanks for taking the time to answer my question. I had a look at some pagination scripts and built the below and...it works fine! <?php$search = $_GET["job"];$start = $_GET["start"];$query = http_build_query(array("job" => $search, "start" => $start+10));echo "<a href='/enterprises-a.php?$query'>Next</a>";?> Link to comment Share on other sites More sharing options...
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now