Page 1 of 1

submitting data to web site.

Posted: Fri Nov 08, 2013 7:46 am
by Tribblehunter
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.

Re: submitting data to web site.

Posted: Sun Nov 10, 2013 11:45 am
by Mark
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

Re: submitting data to web site.

Posted: Mon Nov 11, 2013 3:13 pm
by Tribblehunter
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

Re: submitting data to web site.

Posted: Mon Jan 26, 2015 10:07 pm
by Tribblehunter
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.

Re: submitting data to web site.

Posted: Mon Jan 26, 2015 11:26 pm
by SparkOut
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

Re: submitting data to web site.

Posted: Tue Jan 27, 2015 6:57 pm
by Tribblehunter
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

Re: submitting data to web site.

Posted: Tue Jan 27, 2015 9:45 pm
by Tribblehunter
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.........

Re: submitting data to web site.

Posted: Sun Feb 01, 2015 6:28 pm
by Tribblehunter
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?

Re: submitting data to web site.

Posted: Sun Feb 01, 2015 11:39 pm
by SparkOut
check the headers received for the content type.
If you have Content-Encoding: gzip then you need to decompress the html content.

Re: submitting data to web site.

Posted: Mon Feb 02, 2015 6:58 am
by Tribblehunter
Thanks Sparkout. That makes complete sense.

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

Re: submitting data to web site.

Posted: Mon Feb 02, 2015 7:18 am
by Tribblehunter
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.

Re: submitting data to web site.

Posted: Mon Feb 02, 2015 8:23 am
by SparkOut
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?

Re: submitting data to web site.

Posted: Mon Feb 02, 2015 8:45 pm
by Tribblehunter
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.

Re: submitting data to web site.

Posted: Fri Jan 19, 2018 8:08 am
by faisalchishti
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>