472,787 Members | 1,494 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 472,787 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 18500
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....
3
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 2 August 2023 starting at 18:00 UK time (6PM UTC+1) and finishing at about 19:15 (7.15PM) The start time is equivalent to 19:00 (7PM) in Central...
0
linyimin
by: linyimin | last post by:
Spring Startup Analyzer generates an interactive Spring application startup report that lets you understand what contributes to the application startup time and helps to optimize it. Support for...
0
by: kcodez | last post by:
As a H5 game development enthusiast, I recently wrote a very interesting little game - Toy Claw ((http://claw.kjeek.com/))。Here I will summarize and share the development experience here, and hope it...
0
by: Taofi | last post by:
I try to insert a new record but the error message says the number of query names and destination fields are not the same This are my field names ID, Budgeted, Actual, Status and Differences ...
14
DJRhino1175
by: DJRhino1175 | last post by:
When I run this code I get an error, its Run-time error# 424 Object required...This is my first attempt at doing something like this. I test the entire code and it worked until I added this - If...
0
by: Rina0 | last post by:
I am looking for a Python code to find the longest common subsequence of two strings. I found this blog post that describes the length of longest common subsequence problem and provides a solution in...
5
by: DJRhino | last post by:
Private Sub CboDrawingID_BeforeUpdate(Cancel As Integer) If = 310029923 Or 310030138 Or 310030152 Or 310030346 Or 310030348 Or _ 310030356 Or 310030359 Or 310030362 Or...
0
by: lllomh | last post by:
Define the method first this.state = { buttonBackgroundColor: 'green', isBlinking: false, // A new status is added to identify whether the button is blinking or not } autoStart=()=>{
0
by: lllomh | last post by:
How does React native implement an English player?

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.