The forum of the forums

Would you like to react to this message? Create an account in a few clicks or log in to continue.
The forum of the forums
2 posters

    Log-In/ Account-Switch Widget

    Bones!
    Bones!
    Forumember


    Posts : 173
    Reputation : 20
    Language : English, CCS, HTML
    Location : Behind you

    switch accounts - Log-In/ Account-Switch Widget Empty Log-In/ Account-Switch Widget

    Post by Bones! Sun 7 Dec - 2:58

    I've been searching for this code for a long time. I know people have it, and everything I do to recreate it... failed. Basically it's a widget that has two sections to fill in info. The first being a username, and the second the password. This allows people to switch from one account to the other.

    Can someone please help?
    Tonight
    Tonight
    Forumember


    Male Posts : 312
    Reputation : 80
    Language : Estonian, English, Russian
    Location : Estonia

    switch accounts - Log-In/ Account-Switch Widget Empty Re: Log-In/ Account-Switch Widget

    Post by Tonight Sun 7 Dec - 3:10

    Code:
        <script type="text/javascript">
            function switch_accounts() {
            jQuery.get(document.getElementById('logout').href, function() {
            jQuery.post('/login', 'login=1&username='+document.getElementById('switch_uname').value+'&password='+document.getElementById('switch_pass').value, function () {
            window.location.reload();
            });
            });
            }
            </script>
            Switch user:<hr />
            <input id="switch_uname" type="text" /><br />
            <input id="switch_pass" type="password" /><br />
            <input type="button" value="Switch user" onclick="switch_accounts();" />

      Current date/time is Mon 11 Nov - 17:47