» Knowledgebase - If its not here, Just ask.

Web Control » Resellers

ID #1127

How to create a login page for DirectAdmin on your website

Many webhosts want to make an easy one stop location for logging into DirectAdmin. This can be accomplished by adding a login form on your webpage. It's fairly simple to do, just add the following code to your website:

<style>
*{ FONT-SIZE: 8pt; FONT-FAMILY: verdana; }
b { FONT-WEIGHT: bold; }
.listtitle { BACKGROUND: #425984; COLOR: #EEEEEE; white-space: nowrap; }
td.list { BACKGROUND: #EEEEEE; white-space: nowrap; }
</style>
<table cellspacing=1 cellpadding=5>
<tr>
<td class=listtitle colspan=2>Please enter your Username and Password</td>
</tr>
<form action="http://www.yourdomain.com:2222/CMD_LOGIN" method="POST" name="form">
<input type=hidden name=referer value="/">
<input type=hidden name=FAIL_URL value="http://www.yourdomain.com/login_failed.html">
<input type=hidden name=LOGOUT_URL value="http://www.yourdomain.com/logged_out.html">

<tr>
<td class=list align=right>Username:</td><td class=list><input type=text name=username></td>
</tr>
<tr>
<td class=list align=right>Password:</td><td class=list><input type=password name=password></td>
</tr>
<tr>
<td class=listtitle align=right colspan=2><input type=submit value='Login'></td>
</tr>
</form>
</table>

Replace http://www.yourdomain.com with your domain. If you are using https (ssl) instead of http, be sure to set it to https:// instead of http://.

The visible text has been highlighted in green, so you can change it as needed.

Also included in this form are the optional FAIL_URL and LOGOUT_URL values. You can set them so that if a user enters a wrong usename or password, the login_failed.html will be shown, and when the hit "Logout" from within DirectAdmin, they'll be take to the logged_out.html page. You can change the values as needed, and if you remove those 2 options, then the default DA settings will take over. Both the login_failed.html and logged_out.html would be stored on your own website, and not through DA (as set, in this example).

If you want the login page to go straight to a particular page, you can change the "referer" value from "/" to "/CMD_USER_STATS" for example, if you wanted to go straight to the statistics page upon successful login.

Tags: -

Related entries:

Last update: 2008-12-24 18:30
Author: Support TEAM
Revision: 1.1

Digg it! Print this record Send to a friend Show this as PDF file
Propose a translation for Propose a translation for
Please rate this entry:

Average rating: 0 out of 5 (0 Votes )

completely useless 1 2 3 4 5 most valuable

You cannot comment on this entry