login to a website within a stack

Bringing the internet highway into your project? Building FTP, HTTP, email, chat or other client solutions?

Moderators: FourthWorld, heatherlaine, Klaus, kevinmiller, robinmiller

Post Reply
tzenobite
Posts: 57
Joined: Sun Dec 04, 2011 3:59 pm
Location: italy

login to a website within a stack

Post by tzenobite » Sat Apr 07, 2012 2:34 pm

hi
i've making a stack to access a website that asks to log in

i'm stripped out all the unnecessary code from the login page and that's it:

Code: Select all

<!DOCTYPE HTML>
<form action="http://www.(thesite).it/index.php?option=com_comprofiler&task=login" method="post"/>
<input type="hidden" name="username" value ="(theuser)"/>
<input type="hidden" name="passwd" value="(thepass)"/>
<input type="hidden" name="op2" value="login" />
<input type="hidden" name="lang" value="italian" />
<input type="hidden" name="force_session" value="1" />
<input type="hidden" name="return" value="B:aHR0cDovL3d3dy5lcm94ZS5pdC8=" />
<input type="hidden" name="message" value="0" />
<input type="hidden" name="loginfrom" value="loginform" />
<input type="hidden" name="cbsecuritym3" value="cbm_61edf114_6b35641b_39682c08b1fa208ab4cc314cf29fd720" />
<input type="hidden" name="j825a551ae288257abb759692321af56c" value="1" />
<input type="submit" name="Submit"value="Accesso" /></html>
i've saved this code as text document with simpletext, open the file with safari, click the submit button and log in the website in a hurry
now, i've to do this within a stack, with username and password collected from the user with ask dialogs
i guess i can do this in a "url string" way, like

Code: Select all

http://www.***********.it/index.php?option=com_comprofiler&task=login&username=********&passwd=2**********
...and so on with the other parameters from the form, but it doesn't work
i'm not sure if it isn't working because of me and a wrong url string or because of the site, on this case i have to speak with the webmaster
the other way, i know how to put html code in a script but i don't know to "click a button"...
what do you all out there thinks about?
thanks!
how many hypercardist are needed to change a light bulb? one to actually do it while at least a dozen more are finding out a slightly different way to do it

proudly hypertalking since 1989

shaosean
Posts: 906
Joined: Thu Nov 04, 2010 7:53 am

Re: login to a website within a stack

Post by shaosean » Sun Apr 08, 2012 7:00 am

The actual form is doing a HTTP POST, yet your attempt is doing a HTTP GET.. Try something like this

Code: Select all

local tPostData
put "username=" & urlEncode(USER) & \
     "&passwd=" & urlEncode(PASS) & \
     "&op2=login" & \
     "&lang=italian" & \
     "&force_session=1" & \
     "&return=B:aHR0cDovL3d3dy5lcm94ZS5pdC8=" & \
     "&message=0" & \
     "&loginfrom=loginform" & \
     "&cbsecuritym3=cbm_61edf114_6b35641b_39682c08b1fa208ab4cc314cf29fd720" & \
     "&j825a551ae288257abb759692321af56c=1" & CRLF & CRLF into tPostData

post tPostData to URL "http://www.(thesite).it/index.php?option=com_comprofiler&task=login"
edited this to the (hopefully) proper formatting for the post data, sorry about that

shaosean
Posts: 906
Joined: Thu Nov 04, 2010 7:53 am

Re: login to a website within a stack

Post by shaosean » Sun Apr 08, 2012 9:10 am

Excuse the extra bump, but just to point out that I edited as I noticed that I used the formatting for HTTP header, not HTTP POST..

tzenobite
Posts: 57
Joined: Sun Dec 04, 2011 3:59 pm
Location: italy

Re: login to a website within a stack

Post by tzenobite » Sun Apr 08, 2012 10:11 am

i will try this form too, at the moment i'm stuck with the strange thing that it seems i will log in but i'm not able to get the pages i have to see when i'm logged in
i think that only the webmaster can answer me about it, so i will have to wait some days again, grrrrr

anyway, i'm going to try this form in the new post
thanks
how many hypercardist are needed to change a light bulb? one to actually do it while at least a dozen more are finding out a slightly different way to do it

proudly hypertalking since 1989

Post Reply

Return to “Internet”