多参数模型中的JQuery Mobile 1.4 $ _GET

I'm testing with Jquery Mobile 1.4

I've seen a lot of examples where data between php pages is passed in the URL, but this is always done with multiple php files, for example i have page1.php and a link in a jquery listview is:

<a href="page2.php?id=5">

So in page 2 we can $_GET["id"]

But if we have page2 in a subpage of page1.php, I don't know what is the recommended way of achieving this.

So for example what i want to do is something like have just 1 file called page1.php that will have something like:

<data-role = "page" id="page1">
<listview>
<li><a href=#page2?id=5">

<data-role="page" id="page2">
<?php $_GET["id"] ?>

Obviusly this is not working, but I hope you get the idea. I just want to use $_GET in the #page2, so I can have the id in a variable and use it for some php coding.

Is this possible? What is the recommended way to do this? I guess I'll have to use some javascript.

For the moment I am using multiple php files, but I have to do quite a lot of pages, so I would like to have less files if possible.

Thanks