Page 1 of 1

Post to http building a form with LC

Posted: Sun Apr 14, 2013 2:11 pm
by reelstuff
I am attempting to build a simple form to submit a push notification, to a blind URL, (I cant see the programming behind this URL)

I can get the reply from the server, which tells me if I have the data structured correctly, So I know if it works only by the data returned by the server posted to.

I need to URL encode, only parts of the string, like so,
username=sidney&pass=pass&appid=App1&pushmessage=Test%20message&topics=About%20Us,Latest%20Offers
So really all I need to encode, is the push message and the topics.

I would love to be able to just load the two strings here as a variable, then encode the contents of the variable, I may be over thinking this but I seem to be missing something about how this function works. (URLEncode)

Code: Select all

   put the text of fld "notification_text" into varEncstring
   put URLEncode varEncstring
Obviously I am doing something wrong, as I keep getting errors, the thing is I dont understand the ouput of the error dialog, what does this mean?

compilation error at line 14 Function: missing '('), char 8

Thanks in advance,

Re: Post to http building a form with LC

Posted: Sun Apr 14, 2013 2:28 pm
by jmburnod
Hi reelstuff
URLEncode is a function

Code: Select all

 put URLEncode(varEncstring)
works
Best regards
Jean-Marc

Re: Post to http building a form with LC

Posted: Sun Apr 14, 2013 10:04 pm
by reelstuff
Thank you for your reply, ok, that makes sense, I knew it was simple, so the cryptic, ')' is an indication of what was wrong, I looked at it and it just did not make any sense at all to me, LOL, but now I can see it a little more clearly, I often wonder if now that LC has a foot in the Open Source world perhaps the documentation might get a lot better.

Thanks again, I appreciate it,