kks_krishna Posted October 22, 2007 Share Posted October 22, 2007 HI, How to find the request URL in PHP? Link to comment https://forums.phpfreaks.com/topic/74322-solved-how-to-find-request-url/ Share on other sites More sharing options...
trq Posted October 22, 2007 Share Posted October 22, 2007 Take a look at the $_SERVER array. <?php print_r($_SERVER); ?> Link to comment https://forums.phpfreaks.com/topic/74322-solved-how-to-find-request-url/#findComment-375488 Share on other sites More sharing options...
only one Posted October 22, 2007 Share Posted October 22, 2007 As in the current url? $_SERVER['REQUEST_URI'] For the current root $_SERVER['PHP_SELF']; check the $_SERVER[] manual on the php website. Link to comment https://forums.phpfreaks.com/topic/74322-solved-how-to-find-request-url/#findComment-375490 Share on other sites More sharing options...
kks_krishna Posted October 22, 2007 Author Share Posted October 22, 2007 Thanks, It helped me lot. Link to comment https://forums.phpfreaks.com/topic/74322-solved-how-to-find-request-url/#findComment-375497 Share on other sites More sharing options...
kks_krishna Posted October 23, 2007 Author Share Posted October 23, 2007 hi, $_SERVER['PHP_SELF']; $_SERVER['REQUEST_URI'] working only for the current file. for example i have one url which includes the footer.php. If am using the above variables, it shows the path of the footer file in the server. But i want the main url in the address bar. Link to comment https://forums.phpfreaks.com/topic/74322-solved-how-to-find-request-url/#findComment-375890 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.