PHP code in a page template - cannot reference the same page. (3 posts)

  1. braraman
    Posted 5 years ago #

    I have embeded a PHP script into my page template. This script fetches records from a DB and displays the records. It displays 10 records per page. To test the script , i added 12 records. The first 10 displayed fine. I got a 'Next Page" link, but this link points back to index.php!
    How can i reference the same page in the next link? So the page that has the script, you want on clicking next to come back to it because it has the code to display the next set of records.
    So if the page was called page.php, you provide a 'Next' link that appends additional information to page.php so that second time around, it only displays the records for that page.
    How can i do this?

  2. curlybracket
    Posted 5 years ago #

    I think you should be more specific in order to get an answer.

  3. braraman
    Posted 5 years ago #

    Ok, will explain.

    I have a page and in the template, I have added a form that submits to itself. Also in the page template is the code that handles the form submission. This code retrieves and displays the results. Only 10 records are displayed and links created for page 2, 3 and so on of the results.

    The links for the other pages are dynamically constructed by appending the submitted form data. The code uses

    The problem is $_SERVER['PHP_SELF'] gives index.php. I want it to reference the page with the template code. How can I add that reference to the page?

Topic Closed

This topic has been closed to new replies.

About this Topic