Post282 External Login Guide
You can embed the Post282 community login form into your own website or blog - so users can go directly from your site to your community.
Take a look at an example of a functioning external login page
Note: You first need to create your community, then embed a login page on your site.
To embed the form into your site, you need to follow these quick steps:
1. Add this line of code into the HEAD section of your page:
<script type="text/javascript" src="http://www.post282.com/p282/login.jsp"></script>
This will import the Post282 external login script into your page.
2. Now add this line of code to the very bottom of your page - just after the </HTML> tag :
<script>getSavedLoginDetails(document.getElementsByName('username')[0], document.getElementsByName('password')[0]); document.getElementsByName('externalLogin')[0].value = window.location.href</script>
This will call the external login script in order to retrieve any login details stored on the clients computer (Login details are stored when a user logs with with the 'Remember Me' box ticked).
3. Now add the actual login form. In this example we have arranged the login form using a simple table, but on your site you can set it up whatever way you need:
<table>
<form action="http://www.post282.com/p282/authenticate" target="_top" method="POST" enctype="multipart/form-data" >
<input type="hidden" name="externalLogin" value="" />
<tr>
<td><input onFocus="if(this.value=='Username') {this.value=''}" class="loginBox" value="" onkeypress="return checkEnterSubmit(event)" type="textbox" name="username"/></td>
</tr>
<tr>
<td><input onFocus="if(this.value=='Username') {this.value=''}" class="loginBox" value="" onkeypress="return checkEnterSubmit(event)" type="password" name="password" /></td>
</tr>
<tr>
<td class="rememberMeBox">Remember me<input type="checkbox" name="rememberMe" value="true" checked/></td>
</tr>
<tr>
<td style="text-align: right"><input class="loginButton" type="submit" value="Login"></td>
</tr>
</form>
</table>
4. (Optional) You can change the style of your login box by defining CSS styles in your document. For example, add the following code inside the <HEAD> section of your page:
<style>
.loginBox {
color: #656551;
}
.rememberMeBox {
color: #656551;
font-size: 9px;
text-align: right
}
.loginButton {
color: #656551;
background: #FFF;
border: 1px solid #999
}
</style>
To see an example of an external login page, download the sample code.
If you need help embedding a login box into your site, send us a mail.