using a variable in a url

does anybody know how to use a variable inside a url so that the variable text is part of the url?

thanks

set myVar to “whatever”
open locationhttp://www.” & myVar & “.com”

that script works like that, but I have a prompt come up asking for a part of the url, and that adds on the button returned=“OK” into the url when I put in the variable.

To get info from a dialog box you need this approach:

display dialog “what URL?” default answer “Enter part of URL here” buttons {Get It} default button 1
set myVar to text returned of result
open locationhttp://www.” & myVar & “.com”

if you want to present the choices, you use:
set myVar to (choose from list {“Google”, “Lycos”, “AltaVista”} with prompt “Which search engine do you want?” default items {“Google”} OK button name “Select” cancel button name “Quit” without multiple selections allowed and empty selection allowed) as string
if myVar is not “false” then
open locationhttp://www.” & myVar & “.com”
end if