Skip to content
Advertisement

PHP pagination does not recognize $page

I have downloaded the pagination code and used it for my website running on my local machine. After modifying and testing, there was a problem where it does not recognize the variable $page.

Please refer to the following code:

JavaScript

This is the error it generated:

JavaScript

How can I fix this error?

Advertisement

Answer

This won’t work unless your URL ends with ?page=3 (where 3 would be the current page number). In order to fix it you should change this line

JavaScript

to

JavaScript
User contributions licensed under: CC BY-SA
4 People found this is helpful
Advertisement