Click to See Complete Forum and Search --> : Major Skills: Using Iframes


Celeste!
09-11-2007, 09:27 PM
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?

NogDog
09-12-2007, 04:40 AM
Either (1) escape the quotes around the q with back-slashes, (2) use single quotes around the entire src value instead of double quotes, or (3) use single quotes around the q.

EDIT: I just looked more closely at your post, and realized you're probably using ASP or ColdFusion scripting within the <% . . . %> tags? If so, you may want to see if there is a function you can use to url-encode the text from that variable.

nshiell
09-12-2007, 08:18 AM
you could escape double quotes as %22
so:

fff"ggg = fff%22ggg