If you want to check a user against a FluxBB database...
Do this:
$user = 'username to check';
$pass = 'password to check';
define('PUN_ROOT', '/path/to/forums/'); //DO NOT FORGET THE TRAILING SLASH!!!
include PUN_ROOT . 'include/common.php';
$result = $db->query('SELECT 1 FROM ' . $db->prefix . 'users
WHERE username=\'' . $user . '\'
AND password=\'' . sha1($pass) . '\'');
if ($db->num_rows($result)) {
//user is valid
} else {
//user is invalid
}Thanks to GeonoTRON2000 for inspring me to write this.
Offline
jvvg wrote:
Pitusky12 wrote:
and where do i put this code?
You put this in a script that checks if the user's login credentials are correct.
Such as this one:
http://forums.thegt.org/auth.php?userna … d=password
Offline
GeonoTRON2000 wrote:
jvvg wrote:
Pitusky12 wrote:
and where do i put this code?
You put this in a script that checks if the user's login credentials are correct.
Such as this one:
http://forums.thegt.org/auth.php?userna … d=password
That doesn't work...
Offline
how does it not work?
You login as your username on the GT Forums.
Offline
This is just what I was looking for! Deploying now onto my website
Offline
This can be used as a form... Here's a code to log into the GT forums:
<form action="http://forums.thegt.org/auth.php"> Username: <input type="textarea" name="username"> Password: <input type="password" name="password"> <input type="Submit" value=" Go! "> </form>
At least I think that'll work...
Offline
SciTecCf wrote:
This can be used as a form... Here's a code to log into the GT forums:
Code:
<form action="http://forums.thegt.org/auth.php"> Username: <input type="textarea" name="username"> Password: <input type="password" name="password"> <input type="Submit" value=" Go! "> </form>At least I think that'll work...
But the text area should just be text.
Offline
fg123 wrote:
SciTecCf wrote:
This can be used as a form... Here's a code to log into the GT forums:
Code:
<form action="http://forums.thegt.org/auth.php"> Username: <input type="textarea" name="username"> Password: <input type="password" name="password"> <input type="Submit" value=" Go! "> </form>At least I think that'll work...
But the text area should just be text.
What that will do is it will show you your rank, not log you in.
I'm probably going to use it to make a chat.
Offline
Pitusky12 wrote:
Will this work in Safari? If so,how would i make it work in safari?
It works on any server with FluxBB installed. It is a server-side script, not a browser-side one.
Offline