Post to http building a form with LC

Got a LiveCode personal license? Are you a beginner, hobbyist or educator that's new to LiveCode? This forum is the place to go for help getting started. Welcome!

Moderators: FourthWorld, heatherlaine, Klaus, kevinmiller

Post Reply
reelstuff
VIP Livecode Opensource Backer
VIP Livecode Opensource Backer
Posts: 254
Joined: Mon Apr 16, 2007 12:06 am
Location: USA
Contact:

Post to http building a form with LC

Post by reelstuff » Sun Apr 14, 2013 2:11 pm

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,

jmburnod
VIP Livecode Opensource Backer
VIP Livecode Opensource Backer
Posts: 2718
Joined: Sat Dec 22, 2007 5:35 pm
Location: Genève
Contact:

Re: Post to http building a form with LC

Post by jmburnod » Sun Apr 14, 2013 2:28 pm

Hi reelstuff
URLEncode is a function

Code: Select all

 put URLEncode(varEncstring)
works
Best regards
Jean-Marc
https://alternatic.ch

reelstuff
VIP Livecode Opensource Backer
VIP Livecode Opensource Backer
Posts: 254
Joined: Mon Apr 16, 2007 12:06 am
Location: USA
Contact:

Re: Post to http building a form with LC

Post by reelstuff » Sun Apr 14, 2013 10:04 pm

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,

Post Reply

Return to “Getting Started with LiveCode - Complete Beginners”