Search code examples
phpurlhyperlinkhref

Cannot make a href link to work


I am trying to include pagination on a site and I encountered this problem. I have the following line, but instead of index.php I must put index.php?view_vehicles.

This is the line:

echo "<a href='index.php?page=$next'>Next</a> ";

It's the first time I encounter this issue and I don't know how to make it work.


Solution

  • From comments:

    "It must be something like this: <a href='index.php?view_vehicles?page=$next'>Next</a> but it's now working this way. – AndreiCT

    As I stated, additional GET parameters require & after the first parameter, not 2x ?.

    <a href='index.php?view_vehicles&page=$next'>Next</a>