Jump to content

get the frame's url...


kathas

Recommended Posts

Ok here is the deal...

I want to open a frame then after the user interacts with the page in the frame
i 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

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 here

Just 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

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.