lilman Posted November 18, 2006 Share Posted November 18, 2006 I am trying to pull the url of the page. I looked at php.net and found this function [code]$path_parts = "/public_html/students/index.php"; $file = basename($path_parts);[/code] Basename will read $path_parts and will output this: index.phpI wasn't able to find one that could grab the live url path and return the base name of the file. Does anyone know of a function that can do that? Link to comment https://forums.phpfreaks.com/topic/27647-pull-url/ Share on other sites More sharing options...
trq Posted November 18, 2006 Share Posted November 18, 2006 [code=php:0]$_SERVER['PHP_SELF'];[/code] Link to comment https://forums.phpfreaks.com/topic/27647-pull-url/#findComment-126467 Share on other sites More sharing options...
Caesar Posted November 18, 2006 Share Posted November 18, 2006 Do you mean...[code]<?php$current_path = $_SERVER[SCRIPT_FILENAME];?>[/code]Or[code]<?php$current_path = $PHP_SELF;?>[/code] Link to comment https://forums.phpfreaks.com/topic/27647-pull-url/#findComment-126469 Share on other sites More sharing options...
lilman Posted November 18, 2006 Author Share Posted November 18, 2006 thank you! Link to comment https://forums.phpfreaks.com/topic/27647-pull-url/#findComment-126470 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.