Beginner Programming
 
Forums: » Register « |  User CP |  Games |  Calendar |  Members |  FAQs |  Sitemap |  Support | 
User Name:
Password:
Remember me
Go Back   Dev Shed ForumsOtherBeginner Programming

Reply
Add This Thread To:
  Del.icio.us   Digg   Google   Spurl   Blink   Furl   Simpy   Y! MyWeb 
Thread Tools Search this Thread Rate Thread Display Modes
 
Unread Dev Shed Forums Sponsor:
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  
Old September 18th, 2000, 08:02 AM
erwin.heukels erwin.heukels is offline
Junior Member
Dev Shed Newbie (0 - 499 posts)
 
Join Date: Sep 2000
Location: Netherlands
Posts: 3 erwin.heukels User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: < 1 sec
Reputation Power: 0
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

Reply With Quote
  #2  
Old September 18th, 2000, 08:38 AM
freebsd
Guest
Dev Shed Newbie (0 - 499 posts)
 
Posts: n/a  
Time spent in forums:
Reputation Power:
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.

Reply With Quote
  #3  
Old October 11th, 2000, 03:16 PM
erwin.heukels erwin.heukels is offline
Junior Member
Dev Shed Newbie (0 - 499 posts)
 
Join Date: Sep 2000
Location: Netherlands
Posts: 3 erwin.heukels User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: < 1 sec
Reputation Power: 0
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?

Reply With Quote
  #4  
Old October 11th, 2000, 03:49 PM
freebsd
Guest
Dev Shed Newbie (0 - 499 posts)
 
Posts: n/a  
Time spent in forums:
Reputation Power:
Secure pages work differently. Have a look at -> http://www.devshed.com/Talk/Forums/Forum5/HTML/001630.html

Reply With Quote
Reply

Viewing: Dev Shed ForumsOtherBeginner Programming > Connect to ASP Post-form using URL


Thread Tools  Search this Thread 
Search this Thread:

Advanced Search
Display Modes  Rate This Thread 
Rate This Thread:


Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
View Your Warnings | New Posts | Latest News | Latest Threads | Shoutbox
Forum Jump

 Free IT White Papers!
 
Accelerating Trading Partner Performance
One in five. That's how many partner transactions have at least one error. That is an amazing statistic, particularly given the extraordinary leaps in innovation across the global supply chain during the past two decades. Download this white paper to learn more.

 
Competing on Analytics
This Tech Analysis is designed to help identify characteristics shared by analytics competitors, and includes information about 32 organizations that have made a commitment to quantitative, fact-based analysis.

 
Cost Effective Scaling with Virtualization and Coyote Point Systems
An overview of the industry trend toward virtualization, how server consolidation has increased the importance of application uptime and the steps being taken to integrate load balancing technology with virtualized servers.

 
Five Checkpoints to Implementing IP Telephony
Implementation planning for IP PBX software and IP telephony has become vital as businesses replace discontinued legacy PBX phone systems. This informative whitepaper outlines five "checkpoints" for any implementation plan that will help make IP communications a successful proposition.

 
Hosted Email Security: Staying Ahead of New Threats
In the last two years, email has become a fierce battleground between the nefarious forces of spam and malware, and the heroes of messaging protection. The spam volumes increased alarmingly every month, bringing clever new forms of phishing and virus propagation attacks.

 

Forums: » Register « |  User CP |  Games |  Calendar |  Members |  FAQs |  Sitemap |  Support | 
  
 





© 2003-2008 by Developer Shed. All rights reserved. DS Cluster 1 hosted by Hostway