在网页中创建指向iFrame的外部链接

I have a page with an iFrame in it. I want to be able to send links to people, that will open a page within that iFrame on my page.

The main (parent) page is called results.html The iFrame has the id "searchresults"

The page that I wan people to be able to open within that iFrame is results.php, but it would have a number of parameters in it (for example results.php?id=5)

How would I construct the link to send to people?

For example, would it be /results.html?target="searchresults";?results.php?id=5

I simply can't work it out!

What stops you from simply loading the iFrame and the main frame with the same GET parameters?

Or the place where you add iFrame, simply add the GET parameters of the main page also to the iFrame and then check for their presence in the iFrame code?

For example, I have a page:

index.php

In this page I have an iFrame with an URL:

<iframe src="search.php"></iframe>

If I make a search, then the main page would change:

index.php?search=test

Now when I am generating the iFrame URL, I check if that GET parameter exists, if it exists then I append it to iFrame URL:

<iframe src="search.php?search=test"></iframe>