Nasıl PHP kullanarak benim senaryonun geçerli URL alabilirim?
Bakınız PHP Get Current URL:
Sometimes it is not as straightforward as one may think to get the current url to use it inside your application. Here is a snippet that I use to fetch the current URL and use it in a script. The current url (whether http or https) is now a local variable that you can do with as you please.
$url = "http".(!empty($_SERVER['HTTPS'])?"s":"").
"://".$_SERVER['SERVER_NAME'].$_SERVER['REQUEST_URI'];
Not: Bir sql sorgu gibi, hassas bir şey kullanmadan önce bu değeri damat gerekir.
Hi this is the solution of your problem
/ / Bu page url getirilemedi
$url=$_SERVER['REQUEST_URI'];
echo "$url<br />";
/ / Yazdıracaktır
/ / Bu tarafından ev sahipliği getir
$host=$_SERVER['HTTP_HOST'];
echo "$host<br />";
/ / Eğer bu tam url getirebilir
$fullurl="http://".$_SERVER['HTTP_HOST'].$_SERVER['REQUEST_URI'];
echo $fullurl;