I have a page that consists of two frames.The lower fram has a name, "mainFrame". Is there a way to grab the URL of the lower frame (mainFrame) and store it in a variable? Any help or insight would be greatly appreciated.
You could use a function like file_get_contents to get the whole page and then use a regular expression to find the url of that specific frame. It would be something like: $file = file_get_contents('http://www.mysite.com/mypage.html'); $bottomFrame = preg_match('use some crazy regular expression'); PHP:
hmmmm What if I don't know what will be contained in the lower frame? Know what I mean. What if it is your site that I framed. How would I get the URL info and store it?
jestep is on the right track. Once you grab the page contents, you need to extract the <frame .... > tags. With the tag in hand, extract the name from name="name" portion of the tag and then extract the URL from the src="url" portion of the tag. You need to take into account of the possibility that the URLs will not contain the domain name. Those two pieces of information will allow you to associate names and URLs with the various sections of the page.