2008-01-30, 12:40 AM
Is it possible to make it so your users can log in from another website. Like just have a login box and once they go to the forum they are logged in.
I'm kind of a newb to MyBB.
I'm kind of a newb to MyBB.
<form action="http://domain/MyBBforums/member.php" method="post">
<table border="0" cellspacing="1" cellpadding="4" class="tborder">
<tr>
<td class="thead" colspan="2"><strong>Login</strong></td>
</tr>
<tr>
<td class="trow1"><strong>Username:</strong></td>
<td class="trow1"><input type="text" class="textbox" name="username" size="25" maxlength="30" style="width: 200px;" /></td>
</tr>
<tr>
<td class="trow2"><strong>Password:</strong><br /><span class="smalltext">Please note that passwords are case sensitive.</span></td>
<td class="trow2"><input type="password" class="textbox" name="password" size="25" style="width: 200px;" /></td>
</tr>
</table>
<br />
<div align="center"><input type="submit" class="button" name="submit" value="Login" /></div>
<input type="hidden" name="action" value="do_login" />
<?php
$domain=$_SERVER['HTTP_HOST'];$relativePath=$_SERVER["PHP_SELF"];
$curpurl=$domain$relativePath;
?>
<input type="hidden" name="url" value="<?php echo $curpurl; ?>" />
</form>
jordanlw Wrote:Remove the MyBB bold tags from the form action.
@ Rohan
Thanks
Working great!
Hockey Foo Wrote:Two questions:I have made some changes in the code posted above in post#3. Use it now. Remember to change the action attribute in the first line of the code.
1.) Is there any way so that once they hit the Login button it goes back to the page they were on?
Hockey Foo Wrote:2.) After they have logged in, can it show their user name and have a logout button?You will have to use cookies. Do you know how to play around with cookies?
Rohan Shenoy Wrote:Hockey Foo Wrote:Two questions:I have made some changes in the code posted above in post#3. Use it now. Remember to change the action attribute in the first line of the code.
1.) Is there any way so that once they hit the Login button it goes back to the page they were on?
Hockey Foo Wrote:2.) After they have logged in, can it show their user name and have a logout button?You will have to use cookies. Do you know how to play around with cookies?