Syntax problem

Sarah Reichelt sarahr at genesearch.com.au
Fri May 6 00:59:20 EDT 2005


> I'm trying to create a url to connect to an http server. If I use this 
> code:
>
> get theLink
>
> then, everything works fine. The variable  "theLink" contains a fully 
> formed
> url such as:
>
> "http://www.server.com/path/path.
>
> I'm trying to extend this url by adding the value of another variable
> "subID" which is entered by the user. This additional value needs to be
> added to the original url without breaking it and then initiate a get
> command.
>
> So, the end result will be:
>
> http://www.server.com/path/path/uservalue
>
OK, I see now. What you need to do is work out the exact URL that you 
would need if entering it into a browser address.
For example, to search Google for RunRev, you need the following URL: 
<http://www.google.com/search?q=RunRev>.
If I was allowing a user to do a Google search by clicking on a linked 
word or phrase in a field from my program, I would have something like 
this:

on linkClicked pLink
   put "http://www.google.com/search?q=" & URLencode(pLink) & ">" into 
tURL
   get tURL
   -- do stuff with it
end linkClicked

Test the links in a browser first and look at the address bar to see 
the exact format that the particular site needs. Have you script "put" 
the text it is going to use for getting the URL and keep testing that 
text in a browser until it does what you want. Then switch to using Rev 
to "get" the page.

Cheers,
Sarah




More information about the use-livecode mailing list