|
|
|||||||||
|
|||||||||
| |||||||||
|
|
|
| |||||||||
![]() |
|
|
«
Previous Thread
|
Next Thread
»
|
Thread Tools | Search this Thread | Rate Thread | Display Modes |
|
|
|
Stay one step ahead of the competition. Evaluate and give feedback
on some of the hottest web development tools on the market today.
Make your opinion heard! Click
Here
|
|
#1
|
|||
|
|||
|
When a site uses an ASP form using the "Post" method, I cannot connect to the site using an URL parsing the parameters with ? and &.
Does anybody know how to login to an ASP-site using this method for login-checking (for example from an PERL-script)? Erwin |
|
#2
|
|||
|
|||
|
Start here -> http://www.devshed.com/Talk/Forums/Forum6/HTML/000387.html
Please note that many sites accept form post only from their own site by checking the page referal. |
|
#3
|
|||
|
|||
|
FreeBSD,
Took me some time to install ActivePerl on the Company Laptop, but finally ready for a testdrive... Used your sample on a local .asp simulated ASP Page, which works fine: Code: # script.cgi ############################### #!/usr/local/bin/perl use LWP::UserAgent; my $URL = "http://localhost/eunits/login.asp"; my $ua = new LWP::UserAgent; $ua->timeout(30); $ua->agent("AgentName/0.1 " . $ua->agent); my $req = new HTTP::Request POST => $URL; $req->content_type('application/x-www-form-urlencoded'); $req->content("BegPage=login.htm&PartID=123123123&EmpPIN=1234&Graphics.x=72&Graphics.y=5"); my $res = $ua->request($req); if ($res->is_success) { my $content = $res->content; &output_status($content); exit; } else { &output_status("is_success Failed"); exit; } sub output_status { my (@messages) = @_; print "Content-type: text/htmlnn"; my $message; foreach $message (@messages) { print $message; } } ############################################ # login.asp ############################### <%@ LANGUAGE="VBSCRIPT" %> <HTML> <HEAD> <META NAME="GENERATOR" Content="Microsoft Visual InterDev 1.0"> <META HTTP-EQUIV="Content-Type" content="text/html; charset=iso-8859-1"> <TITLE>Login.htm</TITLE> </HEAD> <BODY TopMargin="0" Leftmargin="0"> <%For each i in request.form response.write i & " = " & request.form(i) & "<br>" Next %> </BODY> </HTML> Result: ======= C:WINDOWSDESKTOPperl>perl script Content-type: text/html <HTML> <HEAD> <META NAME="GENERATOR" Content="Microsoft Visual InterDev 1.0"> <META HTTP-EQUIV="Content-Type" content="text/html; charset=iso-8859-1"> <TITLE>Login.htm</TITLE> </HEAD> <BODY TopMargin="0" Leftmargin="0"> BegPage = login.htm<br>PartID = 123123123<br>EmpPIN = 1234<br>Graphics.x = 72<br>Graphics.y = 5<br> </BODY> </HTML> So the local listener page is able to interpret the posted object. When I run the script to the actual page which is located at "https://eunits.ac.com/login.asp" (with correct data), I get result: C:WINDOWSDESKTOPperl>perl script Content-type: text/html is_success Failed Any suggestions on how to get the actual result from the login.asp page returned? |
|
#4
|
|||
|
|||
|
Secure pages work differently. Have a look at -> http://www.devshed.com/Talk/Forums/Forum5/HTML/001630.html
|
![]() |
| Viewing: Dev Shed Forums > Other > Beginner Programming > Connect to ASP Post-form using URL |
| Thread Tools | Search this Thread |
| Display Modes | Rate This Thread |
|
|
|
|
|