0

I have a form on page, with url like this:

site.com/form.index.html?ref=https://login....

And I get page URL via this code:

http://$_SERVER[HTTP_HOST]$_SERVER[REQUEST_URI]

But as result I get not full URL, just this:

site.com/form.index.html

How can I get full URL?

Midas
  • 7,012
  • 5
  • 34
  • 52
Geranya
  • 31
  • 3

1 Answers1

0

You want to add the query string:

$url = "http://$_SERVER[HTTP_HOST]$_SERVER[REQUEST_URI]$_SERVER[QUERY_STRING]";

Additionally, you may replace the http bit with $_SERVER[REQUEST_SCHEME]:

"$_SERVER[REQUEST_SCHEME]://$_SERVER[HTTP_HOST]$_SERVER[REQUEST_URI]$_SERVER[QUERY_STRING]"
Midas
  • 7,012
  • 5
  • 34
  • 52