View Full Version : Javascript needed for automatic login!!
Freewebspace
Jun 12th 2007, 1:54 am
I need a javascript for automatic login to a admin panel!
My need is to execute a script (with username and password) so that it automatically logins to admin panel
SimplyI need a script by which the button in the form should be clicked automatically!
nico_swd
Jun 12th 2007, 2:27 am
window.onload = function()
{
document.forms[0].submit();
}
Like this?
Freewebspace
Jun 12th 2007, 2:28 am
window.onload = function()
{
document.forms[0].submit();
}
Like this?
yes I tried this
but it did n't work where should I use it?
<FORM NAME="theform" METHOD="post"
ACTION="http://www.indianwebdirectory.info/admin.php" ENCTYPE="text/plain">
<INPUT TYPE="text" NAME="nick" VALUE="" MAXLENGTH=14> Username<BR>
<INPUT TYPE="password" NAME="password" VALUE="" MAXLENGTH=14 > Password<BR>
<INPUT TYPE="submit" VALUE="submit" NAME="submit"CLASS="BUTTON" >
</FORM>
I have form like this in the .php document
When I execute this php file
the form should automatically submit it to the admin page
what I need to do now?
nico_swd
Jun 12th 2007, 2:32 am
How many forms do you have on this page? It should work anywhere, as it submits the form when the window finishes loading. Also, this may be a silly question, but did you put <script> tags around the code?
Freewebspace
Jun 12th 2007, 2:41 am
<html>
<head><title></title>
<SCRIPT LANGUAGE="javascript">
window.onload = function()
{
document.theform.action = 'http://www.indianwebdirectory.info/admin.php';
}
</SCRIPT>
</head>
<body>
<FORM NAME="theform" METHOD="post"
ACTION="http://www.indianwebdirectory.info/admin.php" >
<INPUT TYPE="text" NAME="nick" VALUE="xxxxx" MAXLENGTH=14>
<INPUT TYPE="password" NAME="password" VALUE="xxxxxx" MAXLENGTH=14 >
<INPUT TYPE="submit" VALUE="submit" NAME="submit" CLASS="BUTTON" >
</FORM>
</body>
</html>
I have only this form on the page!
This is the actual form code I am trying to submit!
nico_swd
Jun 12th 2007, 2:54 am
My code works, but you have to change the name of the submit button. It's causing a conflict. You can just change the first letter of "submit" to a capital letter.
NAME="Submit"
Freewebspace
Jun 12th 2007, 4:18 am
Yes it works fine but I need to upload the file to the real server!
But I need some thing like this
when I execute A(a script) from my server
It should automatically login into my mail box!!(at Server B)
Is it possible?
nico_swd
Jun 12th 2007, 11:42 am
And you want this to happen without leaving the page on server A? You can do this with PHP and cURL for example. Or a hidden frame. Depends on what you want to do once you're logged in. Do you want to extract any data or just log in and that's it?
Freewebspace
Jun 22nd 2007, 6:21 am
And you want this to happen without leaving the page on server A? You can do this with PHP and cURL for example. Or a hidden frame. Depends on what you want to do once you're logged in. Do you want to extract any data or just log in and that's it?
Yes both
Is it possible?
vBulletin® v3.8.4, Copyright ©2000-2009, Jelsoft Enterprises Ltd.