View Full Version : Major Skills: using iframes

09-12-2007, 03:25 AM
i'm having trouble passing search terms from a search box to an iframe.
when ever the quotation marks go around the search (with input text name=q) and are passed on to the iframe with <iframe src="http://google.com/search?q=<%=Request("q") %> i get a msg saying the page cannot be displayed.

i'm guessing since Request("q") already has quotation marks it won't allow the contents of 'q' to have quotation marks.

Is there any other way to request the text that was input so that the quotation marks are recognized by google in the iframe?

09-12-2007, 01:14 PM

<iframe src="http://google.com/search?q=<%=Request.form("q") %>">

While Request and Request.form are similar, they are not the same.

Here's some test code that does work so that you can have another example.

<form method="post" action="test.asp">
<input type="text" name="q" size="30" /><br />
<input type="submit" name="B1" value="Search Google!" /><br />
<iframe src="http://www.google.com/search?q=<%= request.form("q") %>" frameborder="0" width="98%" height="400"></iframe>