How to get the current full url (url + snippets) of a web page in php.,

I want to get the current URL that I received as a callback during authorization from Salesforce.com. The data in the URL is part of the fragments. Can anybody help?

+3
source share
3 answers

I believe it with something like $ _SERVER ['SERVER_NAME']. $ _ SERVER ['REQUEST_URI']. $ _ SERVER ['QUERY_STRING'];

http://php.net/manual/en/reserved.variables.server.php

-2
source

With the $ _SERVER variable, you can do this:

echo $_SERVER['SERVER_NAME'] . $_SERVER['REQUEST_URI'];

Take a look at the following page for all available keys: php.net

0
source

$_SERVER ['HTTP_HOST'] $_SERVER ['REQUEST_URI'], HTTP_HOST , URL uri .

define('URI', 'http://Salesforce.com');
echo URI. $_SERVER['REQUEST_URI'];

You cannot return a fragment of a fragment of a URI, since it is used only on the client. If you need it, you will have to manually send them to the server with some JavaScript.

0
source

Source: https://habr.com/ru/post/1776226/


All Articles