473,396 Members | 1,748 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,396 software developers and data experts.

send username/password via perl script instead of using browser

There is a web page that I access frequently and would like to
automate the authentication of the username and password. I would
like to user a perl script but I'm not really sure about the steps.
If someone could point me in the right direction. I don't know if
it's this simple but wouldn't it just be a matter of using the LWP
module. Calling the webpage and passing in the parameters? Any help
would be appreciated.

<html>
<title>Acceso</title>
<head>
<script>
function resetear() {
//document.form1.Usuario.value="";
//document.form1.Pasw.value="";
document.form1.Usuario.focus();
}
function validar(f) {
if (f.Usuario.value.length == 0) {
f.Usuario.focus();
return false;
} else if (f.Pasw.value.length == 0) {
f.Pasw.focus();
return false;
}
return true;
}
</script>
<meta NAME="Author" CONTENT="">
<meta HTTP-EQUIV="Content-Type" CONTENT="text/html;
charset=iso-8859-1">
</head>
<body onLoad="resetear();">
<br>
<center>
<font COLOR="#000080" size="+1"><b>ACCESO USUARIOS
REGISTRADOS</b></font>
<hr WIDTH="60%" SIZE=3 COLOR=#CCCC00>
</center>

<p>&nbsp;</p>
<form NAME="form1" METHOD="post" ACTION="index.php">
<center>
<table BORDER=3 WIDTH="50%" BORDERCOLORDARK=#003399
BORDERCOLORLIGHT=#3399CC RULES="groups" cellpadding=4 bgcolor=#A0A0FF>
<tr><td COLSPAN=2>&nbsp;</td></tr>
<tr>
<td ALIGN="right"><font SIZE=4 COLOR="black">Usuario:</font></td>
<td ALIGN="left"><input TYPE="text" NAME="Usuario" SIZE=14
MAXLENGTH=14></td>
</tr>
<tr>
<td ALIGN="right"><font SIZE=4
COLOR="black">Contrase&ntilde;a:</font></td>
<td ALIGN="left"><input TYPE="password" NAME="Pasw" SIZE=14
MAXLENGTH=14></td>
</tr>
<tr align=center><td COLSPAN=2><br>
<input TYPE="submit" VALUE="Entrar" onCLICK="return
validar(this.form);">
&nbsp;
<input TYPE="reset" VALUE="Borrar">
</td>
</tr>
<tr><td COLSPAN=2>&nbsp;</td></tr>
</table>
</center>
</form>
<br><br>
<br>
</body>
</html>
Jul 19 '05 #1
2 18540
Not sure if it helps, but when I need to do this in a link on a
webpage (that is presenter the user name and password), I use the
following URL:

http://<username>:<password>@<address>

simply replace <address> with the URL of the page, <username> with the
user name and <password> with the password.

On 29 Jul 2004 04:09:03 -0700, cg*******@hotmail.com (john brown)
wrote:
There is a web page that I access frequently and would like to
automate the authentication of the username and password. I would
like to user a perl script but I'm not really sure about the steps.
If someone could point me in the right direction. I don't know if
it's this simple but wouldn't it just be a matter of using the LWP
module. Calling the webpage and passing in the parameters? Any help
would be appreciated.


Jul 19 '05 #2
john brown wrote:
If someone could point me in the right direction. I don't know if
it's this simple but wouldn't it just be a matter of using the LWP
module. Calling the webpage and passing in the parameters? Any help

If you login with a perl/lwp script, your login info (such as the cookie
that the site will likely set) will be set to your lwp cookies, not your
browser, so you won't be logged in when you go back to the site in your
browser anyway. I suppose this would work if the site is checking logins
based on IP, but that's dumb and they shouldn't be doing it...
Jul 19 '05 #3

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

9
by: deko | last post by:
I want to use htaccess for authentication on my php site since I only have a few users who need access to secure areas. So, I created a new directory off public_html (secretDocs) and in that...
11
by: Google Mike | last post by:
I've got RH9 Linux with default PHP. Is there a way to send email on Linux to an Exchange Server from PHP and/or other tools when there is *NOT* SMTP access? Has anyone figured out a way to...
40
by: ian | last post by:
Hi, I'm a newbie (oh no I can here you say.... another one...) How can I get Python to send emails using the default windows email client (eg outlook express)? I thought I could just do the...
2
by: john brown | last post by:
I'm using the following code to retrieve a web page. It seems that I'm able to pass the username and password to the web page, but it does nothing. Looking at the source code of the web page it...
7
by: NewbieJon | last post by:
I am attempting to send the variable "sComputerName" from my ActiveX script to "GetInfo.asp" using javascript. (Having been advised this is the way to get my ActiveX variable into my ASP script) ...
6
by: JK | last post by:
Can anyone provide me with an ASP 2.0 example of how to call the geocoder service. They provide the following perl example for XML-RPC : #!/usr/bin/perl use XMLRPC::Lite; use Data::Dumper;...
14
by: Brent Burkart | last post by:
I am trying to capture the Windows Authenticated username, but I want to be able to capture the login name that exists in IIS, not Windows. In order to enter my company's intranet through the...
0
by: geekneo | last post by:
Guys, I need to send the username and paasword to a website using the perl script so that it automatically logs in the person.Can anybody guide me Regards neo
11
by: fdu.xiaojf | last post by:
Hi, I just want to send a very simple email from within python. I think the standard module of smtpd in python can do this, but I haven't found documents about how to use it after googleing....
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...
0
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.