Search code examples
javascriptphphtmlroundcubedirectadmin

How can i make a login form that logs me in into my webmail?


English is not my native language, so I'm srry if there are some mistakes in this question..

But this is the thing.. I am trying to make a login form on my webpage so I can login to my webmail using my webpage instead of my roundcube.. but when I do that, the webpage is not private so I returns a error..

I am using localhost to login to webmail on a server.. is the problem mabye that it has to be on the same server or is it the code?

<div id="content-wrap"><form action="https:www.glazenwasserijnederpel.nl/webmail" method="post"> <input name="login_theme" type="hidden" value="cpanel" />
                            <table class="login" style="width: 200px;" border="0" cellspacing="0" cellpadding="0">
                                <tbody style="text-align: left;">

                                   <strong>Login, alleen voor leden</strong>

                                <tr style="text-align: left;">
                                    <td class="login_lines" style="text-align: left;">Email:</td>
                                    <td class="login_lines" style="text-align: left;"><input id="user" name="user" size="16" type="text" tabindex="1" /></td>
                                </tr>

                                <tr class="row2" style="text-align: left;">
                                    <td class="login_lines" style="text-align: left;">Password:</td>
                                    <td class="login_lines" style="text-align: left;"><input id="pass" name="pass" size="16" type="password" tabindex="2" /></td>
                                </tr>

                                <tr style="text-align: left;">
                                    <td style="text-align: left;" colspan="2"><input id="login" class="input-button" type="submit" value="Login" tabindex="3" /></td>
                                </tr>

                                </tbody>
                            </table>
                            <input name="goto_uri" type="hidden" value="/?login_theme=cpanel" /> </form> <br /> <br />
                        <script type="text/javascript"><!--
                            /* Must not include external javascript -jnk 06.20.09 */
                            var init = function() {
                                document.getElementById("user").value = '';
                                document.getElementById("pass").value = '';
                                document.getElementById("user").focus();
                            };
                            if( window.addEventListener ) {
                                window.addEventListener('load',init,false);
                            } else if( document.addEventListener ) {
                                document.addEventListener('load',init,false);
                            }
                            // --></script>
                    </div>

Solution

  • Most websites have protection against this sort of form submission, so yes, you have to be on the same server in order to login.