javascript - Get the url parameter or the part of the url after the question mark (?) of an included php file


I basically have this "info.php" file included in another php file which is "main_page.php". By clicking a link in the page, the link sends a url parameter to the "info.php" file through javascript by reloading the page, giving it a new url. The "info.php" file then, for instance, becomes "info.php?student=1" which is, again, to be clear, included inside the "main_page.php" file. I've researched for solutions but what I only found are those javascripts and php scripts that gets the current url in the address bar.

Is there a way to do this, getting the new url of an included php file? If there is, then please forgive me for my dumbness and irresponsibly inadequate researching. Thank you so much.




This is what you are looking for.


Here is the documentation




You should be able to access your URL query variables through the global $_GET array.


If not, please edit your question with some actual code like to have a better idea of what you are trying to achieve.

People are also looking for solutions to the problem: php - Yii2: Change page without reloading the page


Didn't find the answer?

Our community is visited by hundreds of web development professionals every day. Ask your question and get a quick answer for free.

Ask a Question

Write quick answer

Do you know the answer to this question? Write a quick response to it. With your help, we will make our community stronger.

Similar questions

Find the answer in similar questions on our website.