Newbie question here. How would I pass username and password to a login form that is located on a remote web server running asp? Entering http://www.thesite.com/login.asp?userna ... d=password as the URL doesn't work.
Thanks.
Tony.
post to asp site
Moderators: FourthWorld, heatherlaine, Klaus, kevinmiller, robinmiller
That would be using the GET method of submitting, which would not be the method wanted by the server (for password authentication it would be inherently insecure). You need to POST the data to the form.
If go to the web page in your browser and look at the source code, you need to find the names of the items being submitted, so that you can make name=value pairs to POST. If you then get RunRev to make those name and value pairs (using libUrlFormData for example) and put them into theSubmissionData then you should get the server to validate the submission.
Quite what happens after that is another matter. The validation of your login submission will, no doubt, get the server to generate session cookies which under normal circumstances your browser will handle automatically and keep your authenticated session alive for the duration of your connection.
If you use the LiveHTTP headers in Firefox, you will be able to see the real time header exchanges that take place when you log into a site and browse around it. You will see such things as "Set-cookie: xxxxxx" coming from the server, and on your next navigation in that site, your browser will show "Cookie: xxxxxx" in the headers it submits. That can help you understand how the data exchanges work and what you need to look for and pass to the server to log in and navigate around.
In RunRev, you will need to use the libURLLastRHHeaders function to view the response from your login post. In the data returned, you will need to parse out the "Set-cookie:" information and get the values that were set for this session. Then you will need to useor such, that you extracted from the libURLLastRHHeaders result. If RunRev submits that cookie with every request for a page (which it should do, until you reset the httpHeaders) then the server should accept the request as coming from a valid session.
There is some more discussion about this in this thread: http://forums.runrev.com/phpBB2/viewtopic.php?t=2066
HTH
SparkOut
If go to the web page in your browser and look at the source code, you need to find the names of the items being submitted, so that you can make name=value pairs to POST. If you then get RunRev to make those name and value pairs (using libUrlFormData for example) and put them into theSubmissionData then
Code: Select all
post theSubmissionData to URL ("http://thesite.com/login.asp")
Quite what happens after that is another matter. The validation of your login submission will, no doubt, get the server to generate session cookies which under normal circumstances your browser will handle automatically and keep your authenticated session alive for the duration of your connection.
If you use the LiveHTTP headers in Firefox, you will be able to see the real time header exchanges that take place when you log into a site and browse around it. You will see such things as "Set-cookie: xxxxxx" coming from the server, and on your next navigation in that site, your browser will show "Cookie: xxxxxx" in the headers it submits. That can help you understand how the data exchanges work and what you need to look for and pass to the server to log in and navigate around.
In RunRev, you will need to use the libURLLastRHHeaders function to view the response from your login post. In the data returned, you will need to parse out the "Set-cookie:" information and get the values that were set for this session. Then you will need to use
Code: Select all
set the httpHeaders to "Cookie: name=value[;name=value]"
There is some more discussion about this in this thread: http://forums.runrev.com/phpBB2/viewtopic.php?t=2066
HTH
SparkOut
Well... who knows?
It seems to me that it's just showing the last thing you typed in the input line, and the url being put in the message box window suggests that you have a line in your script somewhere that "puts" some data, which presumably is meant to hold the destination.
We'd need to see some more code to be able to know what's going on.
It seems to me that it's just showing the last thing you typed in the input line, and the url being put in the message box window suggests that you have a line in your script somewhere that "puts" some data, which presumably is meant to hold the destination.
We'd need to see some more code to be able to know what's going on.