kathas Posted November 27, 2006 Share Posted November 27, 2006 Ok here is the deal...I want to open a frame then after the user interacts with the page in the framei want to get the frame's new url... is that possible with php???[b]Example:[/b]I have [b]thispage.php[/b] that contains [b]anotherpage.php[/b] and after the user interacting with the [b]anotherpage.php[/b] it becomes [b]anotherpage.php?stuff here[/b]Can i know what has it become???By the way to avoid misunderstanding i have know control over the [b]anotherpage.php[/b] Link to comment https://forums.phpfreaks.com/topic/28629-get-the-frames-url/ Share on other sites More sharing options...
Psycho Posted November 27, 2006 Share Posted November 27, 2006 The PHP would be handled server side and would have no knowledge of what is going on in the browser. Your best bet would be to look for a javascript solution. Link to comment https://forums.phpfreaks.com/topic/28629-get-the-frames-url/#findComment-130969 Share on other sites More sharing options...
kathas Posted November 27, 2006 Author Share Posted November 27, 2006 yeah i googled for javascript solution first couldn't find anything....Thanx for the help [i][b]mjdamato[/b][/i] just had to make sure... Link to comment https://forums.phpfreaks.com/topic/28629-get-the-frames-url/#findComment-130973 Share on other sites More sharing options...
allydm Posted November 27, 2006 Share Posted November 27, 2006 You could use a combination of [b]$_SERVER['PHP_SELF'][/b] and [b]preg_replace()[/b].The $_SERVER['PHP_SELF'] would tell you the url, excluding the www.phpfreaks.com (for example), and then you could just tell the preg_replace() function, to look for /somefolder/thispage.php in the $_SERVER['PHP_SELF'] result, and then replace if with nothing. The result would be that you have the anotherpage.php?stuff hereJust incase i wasn't too clear (i got lost with myself above :))It would be something like.[code]$full_file_name = $_SERVER['PHP_SELF'];$file_name = preg_replace('/somefile/, '', $full_file_name);[/code]That would remove any proceeding folder name (which i have called somefile) and leave you with the file name.That won't work, but it hopefully shows you a process that you could go through. Link to comment https://forums.phpfreaks.com/topic/28629-get-the-frames-url/#findComment-131035 Share on other sites More sharing options...
kathas Posted November 27, 2006 Author Share Posted November 27, 2006 Sure shows a proccess... but ain't that only for pages of my server???I propably wasn't clear but when i say [i]i have know control over the anotherpage.php[/i]i mean it's from another domain...If i am wrong again please tell me and i'll look for it...Thanx a lot! Link to comment https://forums.phpfreaks.com/topic/28629-get-the-frames-url/#findComment-131071 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.