Need help php bridge for WBB

BIOS

Knowledge Seeker
VIP
Joined
Oct 10, 2015
Messages
447
Reaction score
850
Points
208
this is my login script

Code:
            <div id="bottom">
                <div id="left">
                    <div id="panel">
                        <div class="title">User Area</div>
                        <div class="body">
                            <?php
                            if (!$_SESSION["MM_Username"]) {
                                print'<br><form method="POST">
        <center><input type="text" name="username" placeholder="Username" id="login"><br>
        <input type="password"  name="password" placeholder="Passwort"><br><br>
        <input type="submit" value="Login" name="login" width="100" height="25"/><br><p><br>
        <a href="pass_recovery.php">Password vergessen?</a> | <a href="register.php">Registrieren</a></center>';
                                if ($_POST['login']) {
                                    $username = mysql_real_escape_string($_POST['username']);
                                    $password = mysql_real_escape_string($_POST['password']);
                                    $password = sha1(strtoupper($username) . ":" . strtoupper($password));
                                    $doesExist = mysql_query("SELECT `id` FROM auth.account WHERE username='" . $username . "' && sha_pass_hash='" . $password . "' ");
                                    if (mysql_num_rows($doesExist) == 1) {
                                        setcookie('username', $username, time() + 60 * 60 * 24 * 365);
                                        setcookie('password', $password, time() + 60 * 60 * 24 * 365);
                                        header('Location: ' . $website);
                                    } else {
                                        echo 'Wrong Username / Password!';
                                    }
                                }
                            }

need help for an bridge that users login and /or register in WBB
 

kalle

high minded
Contributor
Joined
Oct 28, 2015
Messages
411
Reaction score
253
Points
178
I dont understand you at all, but I would like to help you. Maybe I am noob, but what is WBB? And please be more specific with term 'bridge'. :D
 

BIOS

Knowledge Seeker
VIP
Joined
Oct 10, 2015
Messages
447
Reaction score
850
Points
208
with wbb i means woltlab burning board and a bridge isa modification to login and register with one login or register form
 

kalle

high minded
Contributor
Joined
Oct 28, 2015
Messages
411
Reaction score
253
Points
178
And whats problem with that? Its easy to make switch signin/ up. Just add some javascript to switch between. But in forms add diffrent action taken, or if php is on same page just seperate post requests. I hope that I understand you very well :(
 

BIOS

Knowledge Seeker
VIP
Joined
Oct 10, 2015
Messages
447
Reaction score
850
Points
208
solved i will share it

Code:
//Attempt to make a bridge (Failed) -- Must try again.

                            $insert_account = mysql_query("INSERT INTO tigerforum_users (username,user_password, user_email,user_lang) VALUES ('$username','$password','$email')");
                           
// insert it on register form
 
Top