Javascript needed for automatic login!!

Discussion in 'JavaScript' started by Freewebspace, Jun 12, 2007.

  1. #1
    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!
     
    Freewebspace, Jun 12, 2007 IP
  2. nico_swd

    nico_swd Prominent Member

    Messages:
    4,153
    Likes Received:
    344
    Best Answers:
    18
    Trophy Points:
    375
    #2
    
    window.onload = function()
    {
        document.forms[0].submit();
    }
    
    Code (javascript):
    Like this?
     
    nico_swd, Jun 12, 2007 IP
  3. Freewebspace

    Freewebspace Notable Member

    Messages:
    6,213
    Likes Received:
    370
    Best Answers:
    0
    Trophy Points:
    275
    #3
    yes I tried this

    but it did n't work where should I use it?




    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?
     
    Freewebspace, Jun 12, 2007 IP
  4. nico_swd

    nico_swd Prominent Member

    Messages:
    4,153
    Likes Received:
    344
    Best Answers:
    18
    Trophy Points:
    375
    #4
    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?
     
    nico_swd, Jun 12, 2007 IP
  5. Freewebspace

    Freewebspace Notable Member

    Messages:
    6,213
    Likes Received:
    370
    Best Answers:
    0
    Trophy Points:
    275
    #5
    I have only this form on the page!
    This is the actual form code I am trying to submit!
     
    Freewebspace, Jun 12, 2007 IP
  6. nico_swd

    nico_swd Prominent Member

    Messages:
    4,153
    Likes Received:
    344
    Best Answers:
    18
    Trophy Points:
    375
    #6
    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"
    
    Code (markup):
     
    nico_swd, Jun 12, 2007 IP
  7. Freewebspace

    Freewebspace Notable Member

    Messages:
    6,213
    Likes Received:
    370
    Best Answers:
    0
    Trophy Points:
    275
    #7
    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?
     
    Freewebspace, Jun 12, 2007 IP
  8. nico_swd

    nico_swd Prominent Member

    Messages:
    4,153
    Likes Received:
    344
    Best Answers:
    18
    Trophy Points:
    375
    #8
    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?
     
    nico_swd, Jun 12, 2007 IP
  9. Freewebspace

    Freewebspace Notable Member

    Messages:
    6,213
    Likes Received:
    370
    Best Answers:
    0
    Trophy Points:
    275
    #9
    Yes both


    Is it possible?
     
    Freewebspace, Jun 22, 2007 IP