capturing data sent when submitting a form

A

Antony

i'd like to be able to "capture" the data that is sent when submitting a
form.

is there a way to do this? i can program in vb6, or is there a way to work
out what will be sent from looking at the web page source code?

what i'd like to be able to do is see which field names send what data so i
can then write a program that will log me into various pages automatically,
without me having to type username and password details everytime.

at the moment i'm specifically interested in:
http://www.racingpost.co.uk/shared/rp_restricted_access.sd

any help much appreciated
 
J

Jeffrey Silverman

is there a way to do this?

Of course there is.


Unfortunately, your question is so general that you are not going to get a
good answer. Try doing a project and then come here for *specific* answers
on *specific* questions when you get stuck.

Start here:
http://www.w3schools.com/

Try the "Learn ASP" section if you already know VB or VBScript.
Personally, though, I prefer PHP.
 
M

Martin Jay

Antony <[email protected]> said:
i'd like to be able to "capture" the data that is sent when submitting a
form.
[Snip]

what i'd like to be able to do is see which field names send what data so i
can then write a program that will log me into various pages automatically,
without me having to type username and password details everytime.

at the moment i'm specifically interested in:
http://www.racingpost.co.uk/shared/rp_restricted_access.sd

Don't bother reinventing the wheel: use a password manager instead. I
use Password Agent <http://www.moonsoftware.com/pwagent.asp>. :)

Some -- probably most -- web browsers have password managers built into
them.
 
A

Antony

Martin Jay said:
i'd like to be able to "capture" the data that is sent when submitting a
form.
[Snip]

what i'd like to be able to do is see which field names send what data so
i
can then write a program that will log me into various pages
automatically,
without me having to type username and password details everytime.

at the moment i'm specifically interested in:
http://www.racingpost.co.uk/shared/rp_restricted_access.sd

Don't bother reinventing the wheel: use a password manager instead. I use
Password Agent <http://www.moonsoftware.com/pwagent.asp>. :)

Some -- probably most -- web browsers have password managers built into
them.

trouble is i'm writing an app that parses the data from a password accessed
site, so the pw manager won't be effective in this case.
 
H

Hywel Jenkins

Antony said:
i'd like to be able to "capture" the data that is sent when submitting a
form.

Of course. How else could one make any use of the data that's sent?
is there a way to do this? i can program in vb6, or is there a way to work
out what will be sent from looking at the web page source code?

CGI with PHP, Perl, Python, Pascal, Modula 2, dare I say it - VB6?

what i'd like to be able to do is see which field names send what data

The receiving CGI will get FieldName=FieldData.
 
T

Toby Inkster

Antony said:
what i'd like to be able to do is see which field names send what data so i
can then write a program that will log me into various pages automatically,
without me having to type username and password details everytime.

Problem isn't just catching the form input though. With logins you have to
think about Cookies as such.
 
A

Antony

Jeffrey Silverman said:
Of course there is.


Unfortunately, your question is so general that you are not going to get a
good answer. Try doing a project and then come here for *specific* answers
on *specific* questions when you get stuck.

Start here:
http://www.w3schools.com/

Try the "Learn ASP" section if you already know VB or VBScript.
Personally, though, I prefer PHP.

--
Jeffrey D. Silverman | (e-mail address removed)
Website | http://www.newtnotes.com

Drop "PANTS" to reply by email

i take your point and after doing a little googling have come up with code
like:

Sub Command2_Click()
Dim URL As String
Dim Flags As Long
Dim TargetFrame As String
Dim PostData() As Byte
Dim Headers As String

URL =
"https://loginnet.passport.com/ppsec...4325&da=passport.com&kpp=2&svc=mail&msppjph=1"
' A URL that will accept a POST
Flags = 0
TargetFrame = ""

PostData = "[email protected]&passwd=private"
' VB creates a Unicode string by default so we need to
' convert it back to Single byte character set.
PostData = StrConv(PostData, vbFromUnicode)

Headers = "Content-Type: application/x-www-form-urlencoded" & _
vbCrLf
WebBrowser1.Navigate URL, Flags, TargetFrame, PostData, Headers
End Sub

this will get me logged in, fake id and password notwithstanding. however, i
had to quickly select and copy the url from the address bar in IE to get the
convoluted string as seen above, rather than the www.hotmail.com that i
originally navigate to to login. i suspect i might be able to resolve this
address from within the original html of the submitting page? (my view
source does not work - another problem to solve;-)

it also means that the PostData of login and passwd for the hotmail site
were hardcoded only after i found their names on another site.

hopefully this Q will now be more *specific* : how can i see the data that
is sent to the url when i navigate on a page, perhaps by clicking a submit
button?

i understand that a http post method will not include the submit data in the
url value like a http get method would, therefore i am lost as to how to see
the actual values that are transmitted so i can deduce the final url and
submit data.
 
A

Antony

Toby Inkster said:
Problem isn't just catching the form input though. With logins you have to
think about Cookies as such.

"catching the form input" - now there's a handy phrase.

cookies? bugger
 
J

Jeffrey Silverman

i understand that a http post method will not include the submit data in the
url value like a http get method would, therefore i am lost as to how to see
the actual values that are transmitted so i can deduce the final url and
submit data.

Hmmm...

Your question is very garbled to me. The core of what you are trying to
do, that is. So let me rephrase it to see if I am on track:

Take a website you log into normally, say. HotMail.com. You want to
create a script that directs the proper data to the proper HotMail
processing script on the proper HotMail server, to log you in without
having to type in your username/password every time. Is this correct?

If this is correct, then you need to know the following:

(1) The name of the script/program that processes hotmail logins.
(2) The name of the server that does this.
(3) The names of key/value pairs that carry the proper data.

And I think this is what you were asking in the OP -- How to get the
answers to (1) (2) and (3). Right?

All of this information is available within the HTML form that hotmail
uses to send data.

Example:

<form name="loginForm" action="processLogin.asp">
<input type="text" name="username">Username<br>
<input type="password" name="password">Password<br>
</form>

You need to look within the HTML source of the hotmail login page for
something like the form, above. "action" is the name of the script that
does the processing.

But a more important question is why the heck do you even want to do this?
Modern browsers will save login information for you so you don't have to
type it in. Why not use a modern browser? Firefox, Mozilla, Opera, heck,
even MSIE 6. Use the form fill-in options within the browser.

later...
 
A

Antony

Jeffrey Silverman said:
Hmmm...

Your question is very garbled to me. The core of what you are trying to
do, that is. So let me rephrase it to see if I am on track:

Take a website you log into normally, say. HotMail.com. You want to
create a script that directs the proper data to the proper HotMail
processing script on the proper HotMail server, to log you in without
having to type in your username/password every time. Is this correct?

If this is correct, then you need to know the following:

(1) The name of the script/program that processes hotmail logins.
(2) The name of the server that does this.
(3) The names of key/value pairs that carry the proper data.

And I think this is what you were asking in the OP -- How to get the
answers to (1) (2) and (3). Right?

All of this information is available within the HTML form that hotmail
uses to send data.

Example:

<form name="loginForm" action="processLogin.asp">
<input type="text" name="username">Username<br>
<input type="password" name="password">Password<br>
</form>

You need to look within the HTML source of the hotmail login page for
something like the form, above. "action" is the name of the script that
does the processing.

But a more important question is why the heck do you even want to do this?
Modern browsers will save login information for you so you don't have to
type it in. Why not use a modern browser? Firefox, Mozilla, Opera, heck,
even MSIE 6. Use the form fill-in options within the browser.

later...

--
Jeffrey D. Silverman | (e-mail address removed)
Website | http://www.newtnotes.com

Drop "PANTS" to reply by email

yes you are correct - that is exactly what i'm trying to do.
thanks for the clarification. it is all making a lot more sense to me now
that i've spent the day looking at the page code.

why? i'm writing an app that parses data from a password protected site. i
want my app to obtain the data without me being around to enter the details.

i'm getting the hang of this, although now i need to take cookies into
account....

thanks again
 
A

Antony

Antony said:
"catching the form input" - now there's a handy phrase.

cookies? bugger

solved it. thanks for the cookies pointer - the site wouldn't play without
one in the cookie jar folder
 
T

Toby Inkster

Antony said:
solved it. thanks for the cookies pointer - the site wouldn't play without
one in the cookie jar folder

You can do better than that.

In the VB code you posted earlier, look at the Headers variable. You ought
to be able to add some cookie stuff to that.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,744
Messages
2,569,483
Members
44,901
Latest member
Noble71S45

Latest Threads

Top