How To Echo Own Page Url On Page ? - TechRepublic
Question
June 25, 2021 at 07:47 AM
vihaforge4

How To Echo Own Page Url On Page ?

by vihaforge4 . Updated 3 years, 10 months ago

Php Folks,

My question is My url is this:
https://localhost/Templates/Pagination_Template.php?search=keyword&tbl=links&col=keyword&max=1&page=36

Q1.
If I want to echo on page the url in this following format then how do I do it ?
https://localhost/Templates/Pagination_Template.php?search=keyword&tbl=links&col=keyword&max=1&page=1

Q2.
If I want to echo on page the url in this following format then how do I do it ?
https://localhost/Templates/Pagination_Template.php

I ask because, when I use this:

echo $_SERVER[‘PHP_SELF’];
I get echoed this:
/Pagination_Template.php

And, when I use this:

echo $_SERVER[‘PHP_SELF’];
I get echoed this:
Pagination_Template.php

Q3.
This is relative url:
Pagination_Template.php

But what kind of url is this as it is neither rel or absolute url ?
/Pagination_Template.php

I need all three questions addressed.

Thanks

This discussion is locked

All Comments