paths for webpages "included" in other pages

Ask about general coding issues or problems here.

Moderators: macek, egami, gesf

New php-forum User
New php-forum User
Posts: 3
Joined: Mon Jan 07, 2013 1:48 am

paths for webpages "included" in other pages

Postby Ajoo » Wed May 21, 2014 9:40 am

Hi !

I have created a small website. The main page index.php "includes" the other pages dynamically one of which is say the home page, home.php. The home.php is invoked via a menu. When the mouse is placed on the menu button HOME, the browser message window at the bottom shows the path

localhost/xampp/club/index.php?page = home

Where page is the get variable $_GET['page'] which is polled to see which menu button is clicked and that page is referenced and invoked as shown above for the home page inside the index.php. ( home page is embedded inside the index page. It cannot be referenced and displayed directly. )

The home page then implements pagination to show data from a database. Each page displays 10 results per page. The page buttons, created by pagination, can then be clicked to view the corresponding page's results. A variable called $ pagee = $_GET['pagee'] is used to track the page clicked on and the accordingly display the results of the page.

The problem is that the home page displays the first set of data correctly since it does not need to reference any page via the variable $pagee, but when i try and access the 2nd or any other higher page,
pagination page, I get an error. I am not sure how to access the other pages via $pagee. I am unsure what should be the address for referencing the $pagee = 2 or any other higher page, like 3, 4 ,5 etc.

I tried to use the following:

1. index.php?pagee=2. It takes me to a point where I was before I clicked the home menu button. (I can then click the home menu button and the pagination with the first page is displayed once again. ) Whereas it should have displayed the 2nd pagination page.

2. home.php?pagee=2 gives an error and says that the page cannot be found.

Please someone can help me with this? I really do hope that I was able to explain this.

thanks all for any possible help. really looking forward to some suggestions and solutions.

Return to “PHP coding => General”

Who is online

Users browsing this forum: Bing [Bot] and 6 guests