Forum Moderators: open
Basically, its a search page in the iframe, but I want to create links from other pages that will bring up specific search results in the iframe instead.
Page 1:
page with the link.
Page 2:
page containing the iFrame. (ASP page)
scenario:
Page 1 will send data via the querystring to Page 2. On Page 2, You want to fuel the search results which are displayed within the iFrame on that page.
solution:
On Page 1, let's assume your link is something like 'page2.asp?search=searchkeywords'.
Page 2 you'll have code like this:
<%
Dim mySearchString
mySearchString = Request("search")
%>
<IFRAME SRC="http://www.searchengine.com?find=<%=mySearchString%>"></IFRAME>
The above code grabs the search string and then writes out the iFrame tag. Specifically, you will want to make sure that the SRC attribute matches the format the search engine is looking for.
-=casey=-
The default URL of the iframe is in this format:
sub.domain.com/productsearch/searchhome.aspx?ID=0001&nav=no
The format for search results from this search utility are a slightly different format:
sub.domain.com/productsearch/lineresults.aspx?ID=0001&<search results string>&nav=no
Now, if I was only targeting the iframe with specific search results, this would not be a problem, but users still need to be able to navigate to the iframe normally to conduct their own searches. So I need to use the default url, and swap it out with the preset results only as needed.
Basically, on all pages on my site there is a normal link to "shop online" that brings up the default search page, and I have individual pages showing product samples and I want to link from them saying "click to see more <blue widgets>!" and have the search page open up with <blue widgets> search results.
Thanks for your help! I really appreciate it.
New code to do that:
<%
Dim mySearchString
mySearchString = Trim(Request("search")&"")If (mySearchString <> "") Then
%>
<IFRAME SRC="http://sub.domain.com/productsearch/lineresults.aspx?ID=0001&<%=mySearchString%>&nav=no"></IFRAME>
<%
Else
%>
<IFRAME SRC="http://sub.domain.com/productsearch/searchhome.aspx?ID=0001&nav=no"></IFRAME>
<%
End If
%>
Let me know if that one works.
-=casey=-