Check out the FREE chatroom mod for IPB 3.x

>  (MPFF) Board Login & Redirect v2.3
By: MPFF
Short Description
This is a simple login and redirect script with remember me function for site intergration (localhost sql dbs use the following)

Detailed Description


This is a simple login and redirect script with remember me function for site intergration (localhost sql dbs use the following)
Download

>  (MPFF) Board Login & Redirect v2.3, User Contributed Files
File Information
Date Submitted: January 5, 2008
Downloads: 1,660
Downloads Per Day: 1.7102
Views: 6,801
Compatibility: Invision Power Board v2.2 & 2.3
File Version: v2.3
File Size: 30.447 KBytes
Last Updated: January 5 2008, 11:13 PM
Demo Link: None
Allow Upgrades w/o Your Permission?: No
Upgrade Terms for this Submission: None
Support Topic: Click Here
Report File: Report Broken Mod
File Rating
BadOkGoodGreatExcellent(3.83/5 (6 votes)
Please login to vote.
(you must login to be able to cast your vote)

User Comments (View Topic)
December 4 2008, 12:58 AM
by Alexj17
Currently my code is

<form action='/forums/index.php?act=Login&amp;CODE=01&amp;CookieDate=1&amp;return=http://www.MYWEBISTE.com/$url' method='post' name='LOGIN'>

The $url gets the current url in the browser becuase after login i want it to redirect back to the current page.

The problem with this though is if i have a url which contains '&' signs then these dont get picked up.

How can i solve this ?
October 27 2008, 05:02 PM
by kazurian
Nice mod.
I took the liberty to help some of you guys out here smile2.gif
To have a redirect you need to add this into your form:
CODE
<input type="hidden" name="redirect" value="http://">


And to have it show the username when logged in, you will first need the page to login to your database:
CODE
<?php
$dbhost = 'localhost';
$dbuser = 'username';
$dbpass = 'password';

$conn = mysql_connect($dbhost, $dbuser, $dbpass) or die                      ('Error connecting to mysql');

$dbname = 'databasename';
mysql_select_db($dbname);
?>


You can then add the login code
CODE
<?php if (isset($_COOKIE["member_id"])) {
    if ($_COOKIE["member_id"] == 0) {

echo "<form action='/board/index.php?act=Login&amp;CODE=01' method='post' name='LOGIN'>
<strong>Username</strong>: <input type='text' size='25' maxlength='64' name='UserName' /><br />
<strong>Password</strong>: <input type='password' size='25' name='PassWord' /><br />
Remember Me? <input class='checkbox' type='checkbox' name='CookieDate' value='1' checked='checked' /><br />
<input class='button' type='submit' name='submit' value='Log In' />
</form><br />
<a href='/board/index.php?act=Reg'>Register</a>";
    }
    else { // Content that shows up if logged in
// get the persons username from the database
$query = mysql_query("SELECT `members_display_name` FROM `ibf_members` WHERE `id`=" . mysql_real_escape_string($_COOKIE['member_id']) . " LIMIT 1");

//then you need to get the result into an array
$result = mysql_fetch_assoc($query);

//show the username
echo "Welcome Back {$result['members_display_name']}";
    }
}
else {

echo "<form action='/board/index.php?act=Login&amp;CODE=01' method='post' name='LOGIN' target='_top'>
<strong>Username</strong>: <input type='text' size='25' maxlength='64' name='UserName' /><br />
<strong>Password</strong>: <input type='password' size='25' name='PassWord' /><br />
Remember Me? <input class='checkbox' type='checkbox' name='CookieDate' value='1' checked='checked' /><br />
<input class='button' type='submit' name='submit' value='Log In' />
</form><br />
<a href='/board/index.php?act=Reg'>Become a Member!</a>";
} ?>

September 5 2008, 04:43 PM
by dakotagamerz
"I use this method, but if you login from the web site (not forum) it redirects you to the forum after login, how can I get it to remember where I was then send me there after logging in?" - quoting Zero118

Anyone know if this issue got resolved? I would like know how to do this. I use this simple form also and was wondering if it were possible to display the username once logged-in with the static HTML script provided. So it would like something like:

Welcome, (username) | logout <----this would be if a user would be logged-in.


Great work! Such a great mod, Thanks
August 12 2008, 11:53 AM
by kajutsa
More of general question... look at this code first:

CODE
    else { // Content that shows up if logged in
echo "Welcome {members_display_name}!";
    }


That's the bit that shows a message on the website when a user is already logged in. The default 'header' thingy didn't work for me. I want to simple show the text: "Welcome, <forumusername>!" ... however, what is the code for this? {members_display_name} etc. don't work!

Help me out!
-Kaj
June 19 2008, 11:32 PM
by thebigt
I have an issue, i used your base and added/modifyed a few things. The issue im running into is that i have two seperate servers each with an IPB install. the script i have works on one server (if not logged in dis[play login stuff, if logged in i have it redirecting to another page) but it will not ever redirect on my other server. it always displays the login boxes.

iv got the cookies set the same way on each board as well.
May 15 2008, 12:31 PM
by Smitty
QUOTE (ccwjames @ May 15 2008, 06:54 AM) <{POST_SNAPBACK}>
tried this in dreamweaver last night but knocked half my template out, any ideas?



Revert........
May 15 2008, 12:10 PM
by ccwjames
tried this in dreamweaver last night but knocked half my template out, any ideas?
May 10 2008, 04:38 PM
by Davey-UK
Posted in wrong mod, sorry
May 4 2008, 01:11 PM
by MPFF
i am writing a full site intergration modification which will do this
May 3 2008, 11:54 PM
by zero118
I use this method, but if you login from the web site (not forum) it redirects you to the forum after login, how can I get it to remember where I was then send me there after logging in?


Invision Skins · IPB Skins