0

Hi guy

i don't know if the right place to ask but here the question.
I was looking at some code

this one

var pageNum = this.id;
$("#content").load("pagination_data.php?page=" + pageNum, Hide_Load());
});

i would like a link or answer about why they put ?page= at the end of pagination_data.php
i just don't understand what it is for. I don't know much about javascript and php i study at school javascript and teacher never mention about that and doesn't seem to know it...
If you guy could explain to me will be apreciate.Thank you.

2
Contributors
3
Replies
4
Views
5 Years
Discussion Span
Last Post by simplypixie
0

It adds the correct data to the end of the URL that will be used by $_GET (in PHP) on the next page/set of results to display the next set of results.

So if you are on page 1 or results and click on the link to go to page 2, with the code example, the link in the address bar would look like pagination_data.php?page=2 and this tells the script that you want to view page 2 of the results.

So, in short, it is used to send information in the URL to the receiving page which is then accessed using $_GET.

0

If i understand page= its like a variable that i send to $_GET and get the value??

Maybe i am wrong just correct me.

0

Yes that is correct and page= is called whatever you want to use as your get value on the next page so as in any variable declarations you can call it what you like.

This topic has been dead for over six months. Start a new discussion instead.
Have something to contribute to this discussion? Please be thoughtful, detailed and courteous, and be sure to adhere to our posting rules.