$GET outside/parent page

This may be a bit confusing, but this is what I have so far.

I have a parent page, which uses JQuery.load() to load into it a child php page. This parent page has the url: localhost/piproject/roster.php?id=2

Inside of my child php page, I want to access that id#, however $_GET["id"] is null because the child page actually has it's own sub-url (not the technical term).

I want to have that child page refresh without affecting the parent page, so I am using setInterval() on my function which does the .load(). How can I achieve this functionality, and also be able to access the page id?

Answers


You can print the id into a javascript variable on the parent page.

<script>
    var pageId = <?= $_GET['id'] =>;   // integer
    var pageId = "<?= $_GET['id'] =>"; // string
</script>

Need Your Help

Improve performance of PostgreSQL array queries

sql arrays postgresql bigdata postgresql-performance

I am storing large vectors (1.4 million values) of doubles in a PostgreSQL table. This table's create statement follows.

Why is Self assignable in Delphi?

delphi oop language-features self delphi-prism

This code in a GUI application compiles and runs: