Have you ever wanted to allow your users to sign into their phpBB 3 accounts from your homepage? In this tutorial, I'm going to show you how!
All you need is:
- A web host with PHP and MySQL.
- An installed copy of phpBB 3.
- A website to integrate it with.
Hit more to see the rest of the tutorial
Integrating phpBB 3's login is actually very simple. All it involves is pasting (and editing where necessary) a single piece of code, and here it is:
<form method="post" action="http://www.PATHTOYOURFORUMS/ucp.php?mode=login">
<p><input name="username" type="text" id="username" /></p>
<p><input name="password" type="password" id="password" /></p>
<p><input name="redirect" value="where/to/go/after/login" type="hidden">
<input name="login" class="mainoption" value="Log in" type="submit"></p>
</form>
Place this code (or similar code to suit your needs) into your templates login area. The most important parts of this code, and the bits it cannot function without are:
<form method="post" action="http://www.PATHTOYOURFORUMS/ucp.php?mode=login">
Without this piece of code, the form doesn't know where to send the details to; and without the details being sent to the right place, the login won't get processed. Make sure you change "http://www.PATHTOYOURFORUMS/" to your forums domain and folder (EG "www.dailytip.net/forum/"). Also, each input tag needs to keep its name no matter what. Without the names being as they are, phpBB 3 cannot get hold of the details the user has submitted.
The final piece of important code tells the script where to send users who have successfully logged in.
<input name="redirect" value="where/to/go/after/login" type="hidden">
Change the value to the place you want users to be sent; for example "./forums/" or "index.php".
I hope this short tutorial helped you on your way.