Jump to content

how to get the current url


hno

Recommended Posts

$_SESSION["PHP_SELF"];

Do you mean $_SERVER['PHP_SELF']; ?

 

But when i use echo $_SERVER['PHP_SELF']; it didn't return anything?

 

It should, it will return the directory/file in terms of the root folder.

 

<?php

echo $_SERVER['PHP_SELF'];

?>

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.