submitting data to web site.

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
Tribblehunter
Posts: 78
Joined: Wed Apr 10, 2013 9:08 pm

submitting data to web site.

Post by Tribblehunter » Fri Nov 08, 2013 7:46 am

Hi all. Progressing nicely with this learning curve. Now playing around with Post command.

Here is the situation:
I have a website with a password entry.
I have managed to fill a text field with the text of the page with this code (i need to access some links on the site to download information) using this code.

Code: Select all

  post someData to URL  "http://username:password@vppneuapps.volvo.com/png/publlist/Default.aspx?type=7&lang=en"
   get the urlResponse
   set the text of fld "urlContent" to  urlResponse
This puts the following into the field. It is an auto submit page it seemd. I have never seen this when I login via a browser.

Code: Select all

<HTML><HEAD><TITLE></TITLE></HEAD><BODY onLoad="document.AUTOSUBMIT.submit();">This page is used to hold your data while you are being authorized for your request.<BR><BR>You will be forwarded to continue the authorization process. If this does not happen automatically, please click the Continue button below.<FORM NAME="AUTOSUBMIT" METHOD="POST" ENCTYPE="application/x-www-form-urlencoded" ACTION="https://vppneuapps.volvo.com/siteminderagent/forms/penta.fcc?TYPE=33554433&REALMOID=06-00018b4c-f482-121a-b6e8-839687c70006&GUID=&SMAUTHREASON=0&METHOD=POST&SMAGENTNAME=-SM-dymceVd%2fbOpoVhchknzOwuyVSNuRugGLPNAHd2U9NOJhlIZ1924gWI4z8NAuPHjZ&TARGET=-SM-HTTP%3a%2f%2fvppneuapps%2evolvo%2ecom%2fpng%2fpubllist%2fDefault%2easpx%3ftype%3d7%26lang%3den"><INPUT TYPE="HIDDEN" NAME="SMPostPreserve" VALUE="bn6R+HObtJ5jbXlYNOeM44h00GYtX+HpFISMYMSYRgix4/MKa8nw90TNEZd4V5qF"><INPUT TYPE="SUBMIT" VALUE="Continue"></FORM></BODY></HTML>
I am understanding more and more how to send information (effectively bypassing the rendering of the page) but I am stumped at present as to what I would do in Livecode to submit this information back to the server to gain access.

Any pointers would be greatly appreciated. Have searched but can not find a post or tutorial which explains it clearly.
Returning to try to learn livecode again.

But much greyer at the temples than the last time.

Mark
Livecode Opensource Backer
Livecode Opensource Backer
Posts: 5150
Joined: Thu Feb 23, 2006 9:24 pm
Contact:

Re: submitting data to web site.

Post by Mark » Sun Nov 10, 2013 11:45 am

Hi,

The ACTION parameter in the data returned tells you the next page to download to get the results from your login action. Don't forget to get the cookies from the previous post and include these cookies in the httpHeaders.

Perhaps I should add that this web page probably wasn't made for logging in this way. If you are the owner of the website, you might want to add some PHP scripts to simplify communications between server and client.

Kind regards,

Mark
The biggest LiveCode group on Facebook: https://www.facebook.com/groups/livecode.developers
The book "Programming LiveCode for the Real Beginner"! Get it here! http://tinyurl.com/book-livecode

Tribblehunter
Posts: 78
Joined: Wed Apr 10, 2013 9:08 pm

Re: submitting data to web site.

Post by Tribblehunter » Mon Nov 11, 2013 3:13 pm

thanks for the pointer Mark. I am learning what it it that the web site sends and recieves now.
It is not my site, and is a bit of a hack for a planned mobile/web app.

Using wireshark to see what is sent and returned, then working it all out to imitate the data stream.

All fun and great learning!lol
Returning to try to learn livecode again.

But much greyer at the temples than the last time.

Tribblehunter
Posts: 78
Joined: Wed Apr 10, 2013 9:08 pm

Re: submitting data to web site.

Post by Tribblehunter » Mon Jan 26, 2015 10:07 pm

Returning to this project after a year being tied up in other stuff, and learning more livecode::

Am trying to handle re-direct but unsure how to include cookies etc.

Will update my progress, but any advice or pointers always welcome.
Returning to try to learn livecode again.

But much greyer at the temples than the last time.

SparkOut
Posts: 2834
Joined: Sun Sep 23, 2007 4:58 pm

Re: submitting data to web site.

Post by SparkOut » Mon Jan 26, 2015 11:26 pm

This subject is quite specific to different sites and setups, but the thread here may give some insights: http://forums.livecode.com/viewtopic.php?f=7&t=16602

Tribblehunter
Posts: 78
Joined: Wed Apr 10, 2013 9:08 pm

Re: submitting data to web site.

Post by Tribblehunter » Tue Jan 27, 2015 6:57 pm

thanks Sparkout.

That thread has confirmed some of my thoughts and put me on the right path I think.

Will experiment now and see how confused i can get. :D
Returning to try to learn livecode again.

But much greyer at the temples than the last time.

Tribblehunter
Posts: 78
Joined: Wed Apr 10, 2013 9:08 pm

Re: submitting data to web site.

Post by Tribblehunter » Tue Jan 27, 2015 9:45 pm

Now things are becoming a bit clearer. Or rather I have more things to understand before I can crack it. :D

Site uses a siteminder system (for logins etc) . I can find references for CA SiteMinder via google , but do not know if this is the one they use.

More reading required.........
Returning to try to learn livecode again.

But much greyer at the temples than the last time.

Tribblehunter
Posts: 78
Joined: Wed Apr 10, 2013 9:08 pm

Re: submitting data to web site.

Post by Tribblehunter » Sun Feb 01, 2015 6:28 pm

Well It kind of worked.......

managed to deal with re-directs, and cookies, and lots of other things.....

now the login appears to works and gets to a page which I can see in the data (put recieved data into variablew to view).

This is a screenprint of what I have received from the website..... Attached document. Anyone got any pointers?
Attachments
Untitled.png
Screenprint of data in the 'it' variable
Returning to try to learn livecode again.

But much greyer at the temples than the last time.

SparkOut
Posts: 2834
Joined: Sun Sep 23, 2007 4:58 pm

Re: submitting data to web site.

Post by SparkOut » Sun Feb 01, 2015 11:39 pm

check the headers received for the content type.
If you have Content-Encoding: gzip then you need to decompress the html content.

Tribblehunter
Posts: 78
Joined: Wed Apr 10, 2013 9:08 pm

Re: submitting data to web site.

Post by Tribblehunter » Mon Feb 02, 2015 6:58 am

Thanks Sparkout. That makes complete sense.

I am guessing i will have to use revzip for this. Will try it and report.
Returning to try to learn livecode again.

But much greyer at the temples than the last time.

Tribblehunter
Posts: 78
Joined: Wed Apr 10, 2013 9:08 pm

Re: submitting data to web site.

Post by Tribblehunter » Mon Feb 02, 2015 7:18 am

Looked into it and it appears the infomation is difficult to display in Livecode......

Ran out of time this morning, so will pick up the ball later.

Meanwhile if anyone has any more pointers it is appreciated.
Returning to try to learn livecode again.

But much greyer at the temples than the last time.

SparkOut
Posts: 2834
Joined: Sun Sep 23, 2007 4:58 pm

Re: submitting data to web site.

Post by SparkOut » Mon Feb 02, 2015 8:23 am

If it is a case of content being gzip compressed, that thread I pointed you to has the very simple decompression method in the handler I provided. If it is that the content is not renderable then what is it and what do you hope to extract from it?

Tribblehunter
Posts: 78
Joined: Wed Apr 10, 2013 9:08 pm

Re: submitting data to web site.

Post by Tribblehunter » Mon Feb 02, 2015 8:45 pm

Thanks Sparkout.

Missed that in the volume of your code. Now i see how easy it is!!

I now have login access and a page to parse!!

The prog is an automatic checker for new manuals and buletins with ability to download said docs. For automotive type market.
Returning to try to learn livecode again.

But much greyer at the temples than the last time.

faisalchishti
Posts: 1
Joined: Fri Jan 19, 2018 8:05 am

Re: submitting data to web site.

Post by faisalchishti » Fri Jan 19, 2018 8:08 am

Hi. Were you able to bypass siteminder and access the site? I am trying to achieve the same using CURL but I am stuck at a point where the site return me a form that looks like below:

<HTML><HEAD><TITLE></TITLE></HEAD><BODY onLoad="document.AUTOSUBMIT.submit();">This page is used to hold your data while you are being authorized for your request.<BR><BR>You will be forwarded to continue the authorization process. If this does not happen automatically, please click the Continue button below.<FORM NAME="AUTOSUBMIT" METHOD="POST" ENCTYPE="application/x-www-form-urlencoded" ACTION="https://sam.fmr.com/ESG_AuthN/redirect. ... tm"><INPUT TYPE="HIDDEN" NAME="SMPostPreserve" VALUE="71Bg1NcF3P6QEJr54gABT+0q3tRnqtUhfNeBU6oLqz7295LXuAG/2ujiI7bSc2IS"><INPUT TYPE="SUBMIT" VALUE="Continue"></FORM></BODY></HTML>

Post Reply

Return to “Getting Started with LiveCode - Complete Beginners”