I am getting proper url by $_SERVER[REQUEST_URI]
by GET method
, but it doesn't work with POST
.
Is there any alternative to $_SERVER[REQUEST_URI]
so that I get url of post line like so: url=www.example.com?id=12&name=xyz&address=pqr
I am getting proper url by $_SERVER[REQUEST_URI]
by GET method
, but it doesn't work with POST
.
Is there any alternative to $_SERVER[REQUEST_URI]
so that I get url of post line like so: url=www.example.com?id=12&name=xyz&address=pqr
use laravel Request facade Request::fullUrl();
to get the url of request
$link = "http://$_SERVER[HTTP_HOST]$_SERVER[REQUEST_URI]";
This should do the job for you.