phpBB

Development Wiki

Practical.External login

From phpBB Development Wiki

Guide to Creating an External, to the forum, login

So Users can login to your forum, this can be done as a full on separate login page, or you can just include this block of HTML in the footer of your website, for example

The Basic HTML Block

The simplest method of creating a login page, on your main website, is to include a block of html, You will need to change phpBB3 to whatever folder your forum is in

<form action="./phpBB3/ucp.php?mode=login" method="post">
    <
h3><a href="./phpBB3/ucp.php?mode=login">Login</a>&nbsp; &bull; &nbsp; <a href="./phpBB3/ucp.php?mode=register">Register</a></h3>
    <
fieldset>
        <
label for="username">Username:</label>&nbsp;
        <
input type="text" name="username" id="username" size="10" title="Username" />
        <
label for="password">Password:</label>&nbsp;
        <
input type="password" name="password" id="password" size="10" title="Password" />
        <
input type="submit" name="login" value="Login" />
    </
fieldset>
</
form>

Its optional, but recommended to include the quick login "Remember me" Checkbox. Just include the following after the password input

<label for="autologin">Log me on automatically each visit <input type="checkbox" name="autologin" id="autologin" /></label>


When a user logs in, they are given a success or fail message. If the login is successful, the user will be redirected to the forum index. However you can specify your own redirect location by setting the redirect variable. Ensure that the redirect input is place within the <form></form> tags. The redirect should be a relative path within your own domain.

<input type="hidden" name="redirect" value="./somefile.html" />

The above examples have been provided without any CSS class or styles applied. You may add your own class/style to match the style of your site.