This is a read-only archive of the old Scratch 1.x Forums.
Try searching the current Scratch discussion forums.

#1 2012-07-19 13:07:35

jvvg
Scratcher
Registered: 2008-03-26
Posts: 1000+

Checking passwords against a FluxBB database

If you want to check a user against a FluxBB database...
Do this:

Code:

$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.


http://tiny.cc/zwgbewhttp://tiny.cc/e1gbewhttp://tiny.cc/zygbewhttp://tiny.cc/izgbew
Goodbye, Scratch 1.4  sad                                                        Hello Scratch 2.0!  smile

Offline

 

#2 2012-07-19 18:58:43

Pitusky12
Scratcher
Registered: 2011-09-21
Posts: 500+

Re: Checking passwords against a FluxBB database

and where do i put this code?


Scratch 2.0 Beta Tester  wink

Offline

 

#3 2012-07-19 19:00:38

jvvg
Scratcher
Registered: 2008-03-26
Posts: 1000+

Re: Checking passwords against a FluxBB database

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.


http://tiny.cc/zwgbewhttp://tiny.cc/e1gbewhttp://tiny.cc/zygbewhttp://tiny.cc/izgbew
Goodbye, Scratch 1.4  sad                                                        Hello Scratch 2.0!  smile

Offline

 

#4 2012-07-19 20:08:55

GeonoTRON2000
Scratcher
Registered: 2009-12-24
Posts: 1000+

Re: Checking passwords against a FluxBB database

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


http://i.imgur.com/BAEgGDL.png

Offline

 

#5 2012-07-19 20:11:27

wolfdude999
Scratcher
Registered: 2012-01-07
Posts: 1000+

Re: Checking passwords against a FluxBB database

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...


http://i48.tinypic.com/15yxmp4.png

Offline

 

#6 2012-07-19 23:34:53

GeonoTRON2000
Scratcher
Registered: 2009-12-24
Posts: 1000+

Re: Checking passwords against a FluxBB database

how does it not work?
You login as your username on the GT Forums.


http://i.imgur.com/BAEgGDL.png

Offline

 

#7 2012-07-20 02:42:34

Zeusking19
Scratcher
Registered: 2011-07-10
Posts: 1000+

Re: Checking passwords against a FluxBB database

This is just what I was looking for! Deploying now onto my website


http://i49.tinypic.com/2w7e1jm.pnghttp://dragcave.net/image/eFGFz.gifhttp://dragcave.net/image/9hE5q.gif

Offline

 

#8 2012-07-20 05:17:52

SciTecCf
Scratcher
Registered: 2011-11-23
Posts: 1000+

Re: Checking passwords against a FluxBB database

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...


http://bit.ly/LCZEJRhttp://bit.ly/LSONcOhttp://bit.ly/LF3vIc
http://trinary.site40.net/images/scratchrank.php?username=SciTecCf&amp;display=small

Offline

 

#9 2012-07-20 10:22:15

fg123
Scratcher
Registered: 2008-11-13
Posts: 1000+

Re: Checking passwords against a FluxBB database

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.


Hai.

Offline

 

#10 2012-07-20 11:17:57

GeonoTRON2000
Scratcher
Registered: 2009-12-24
Posts: 1000+

Re: Checking passwords against a FluxBB database

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.


http://i.imgur.com/BAEgGDL.png

Offline

 

#11 2012-07-21 14:58:32

Pitusky12
Scratcher
Registered: 2011-09-21
Posts: 500+

Re: Checking passwords against a FluxBB database

Will this work in Safari? If so,how would i make it work in safari?


Scratch 2.0 Beta Tester  wink

Offline

 

#12 2012-07-21 17:19:44

jvvg
Scratcher
Registered: 2008-03-26
Posts: 1000+

Re: Checking passwords against a FluxBB database

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.


http://tiny.cc/zwgbewhttp://tiny.cc/e1gbewhttp://tiny.cc/zygbewhttp://tiny.cc/izgbew
Goodbye, Scratch 1.4  sad                                                        Hello Scratch 2.0!  smile

Offline

 

Board footer