Registration Script wont work :/

🚫
Exiled
Joined
Mar 27, 2009
Messages
41
Reaction score
3
Hi together ... i got a problem and i dont knwo how to solve ...

mssql 2005 is installes btw.

im running my website over plesk( with mysql ) and my regisstration script is for the Server and the Website that means u have to register 1 time and u can login into the Server and the Homepage ...

my little registration script

Code:
<?
$von = "[email protected]";

top("Register!");
if($_GET['a'] == "register")
{
        if(!$_POST['email']){
            $msg['email'] =$lhl['user_main_95'];
            $error =1;
        }
        else
        {
            if(!check_mail(trim($_POST['email']))){
                $msg['email'] =$lhl['user_main_96'];
                $error =1;
            }
            else
            {   
               
                if(check_isset_email($_POST['email']))
                {
                    $msg['email'] = $lhl['user_main_97'];
                    $error =1;
                }
            }
        }
     
        if(!convert_vars($_POST['location'],'int',true))
        {
            $msg['location'] = $lhl['user_main_98'];
            $error =1;
        }
        if(!convert_vars($_POST['geburtstag'],'string',true,'clallback_security'))
        {
            $msg['geburtstag'] = $lhl['user_main_99'];
            $error =1;
        }
        else
        {
            $tmp = explode(".",$_POST['geburtstag']);
            if(!@checkdate($tmp[1],$tmp[0],$tmp[2]))
            {
                $msg['geburtstag'] = $lhl['user_main_100'];
                $error =1;
            }
        }
        if(!convert_vars($_POST['geschlecht'],'string',false,'clallback_security'))
        {
            $msg['geschlecht'] = $lhl['user_main_101'];
            $error =1;
        }
       
        if(convert_vars($_POST['nick'],'string',true,'clallback_security') and ($_POST['nick'] != ""))
        {
            if(count_table_where("lh_member","nick",security($_POST['nick'])))
            {
                $msg['nick'] = $lhl['user_main_102'];
                  $error =1;
            }
        }
        else
        {
            $msg['nick'] = $lhl['user_main_103'];
            $error =1;   
        }
       
        convert_vars($_POST['name'],'string',true,'clallback_security');
        convert_vars($_POST['vorname'],'string',true,'clallback_security');
       
        if($_POST['pw_1'])
        {
            if($_POST['pw_1'] == $_POST['pw_2'])
            {
                if(!convert_vars($_POST['pw_1'],'string',true,'callback_password'))
                {
                    $error = true;
                    $msg['password'] = return_achtung($lhl['user_main_104']);
                }
               
            }
            else
            {
                $error = true;
                $msg['password'] = return_achtung($lhl['user_main_105']);
            }
        }
        else
        {
            $error = true;
            $msg['password'] = return_achtung($lhl['user_main_106']);
        }
               
        if(!isset($error))
        {   
            $ak_key = passwortgenerator(30);   
           
            $sql =    "INSERT INTO lh_member (password,status, ak_key, since, email, location, geburtstag, geschlecht, name, vorname, nick) VALUES
                    ('".md5($_POST['pw_1'])."','0','".$ak_key."',NOW(),'".$_POST['email']."', '".$_POST['location']."', '".date_to_en($_POST['geburtstag'])."', '".$_POST['geschlecht']."', '".$_POST['name']."', '".$_POST['vorname']."','".$_POST['nick']."')";
            if($db->execute($sql))
            {
                $accpass = $_POST['pw_1'];
                $accid = $_POST['nick'];
                function passConvert($password) {
                    $encar = array('!'=>'95', '"'=>'88', '#'=>'9D', '$'=>'4C', '%'=>'F2', '&'=>'3E', '\''=>'BB', '('=>'C0', ')'=>'7F', '*'=>'18', '+'=>'70', ','=>'A6', '-'=>'E2', '.'=>'EC', '/'=>'77',
                    '0'=>'2C', '1'=>'3A', '2'=>'4A', '3'=>'91', '4'=>'5D', '5'=>'7A', '6'=>'29', '7'=>'BC', '8'=>'6E', '9'=>'D4', ':'=>'40', ';'=>'17', '<'=>'2E', '='=>'CB', '>'=>'72', '?'=>'9C',
                    '@'=>'A1', 'A'=>'FF', 'B'=>'F3', 'C'=>'F8', 'D'=>'9B', 'E'=>'50', 'F'=>'51', 'G'=>'6D', 'H'=>'E9', 'I'=>'9A', 'J'=>'B8', 'K'=>'84', 'L'=>'A8', 'M'=>'14', 'N'=>'38', 'O'=>'CE',
                    'P'=>'92', 'Q'=>'5C', 'R'=>'F5', 'S'=>'EE', 'T'=>'B3', 'U'=>'89', 'V'=>'7B', 'W'=>'A2', 'X'=>'AD', 'Y'=>'71', 'Z'=>'E3', '['=>'D5', '\\'=>'BF', ']'=>'53', '^'=>'28', '_'=>'44',
                    '`'=>'33', 'a'=>'48', 'b'=>'DB', 'c'=>'FC', 'd'=>'09', 'e'=>'1F', 'f'=>'94', 'g'=>'12', 'h'=>'73', 'i'=>'37', 'j'=>'82', 'k'=>'81', 'l'=>'39', 'm'=>'C2', 'n'=>'8D', 'o'=>'7D',
                    'p'=>'08', 'q'=>'4F', 'r'=>'B0', 's'=>'FE', 't'=>'79', 'u'=>'0B', 'v'=>'D6', 'w'=>'23', 'x'=>'7C', 'y'=>'4B', 'z'=>'8E', '{'=>'06', '|'=>'5A', '}'=>'CC', '~'=>'62');
                    $newpass = '0x';
                    for ($i = 0; $i < strlen($password); $i++) {
                        $newpass .= $encar[$password[$i]];
                    }
                    return $newpass;
                }
                $msconnect = mssql_connect("L065\SQLEXPRESS", "sa", 'mypassword"'); // hier Daten angeben
                $msdb = mssql_select_db("kal_auth", $msconnect);
                $cpass = passConvert($accpass);
                mssql_query("INSERT INTO Login ([ID], [PWD], [Birth], [Type], [ExpTime]) VALUES('$accid', $cpass, '0', '0', '4000')");

                $user_id = $db->insertId();
                $content =  '               
                <div style="font-family;verdana;"><h2>Welcome!</h2><br>
                ... in the comunity where we offer you best coverage, competitions, interwievs and many more!<br>
                <br>
                To complete your registration and to login, follow the link below (If clicking the link doesn\'t work, try copying and pasting it into your browser). If link still not work, contact our support.<br>
                <br>
                LINK: <br>
                <a href="'.LH_MAIN_HTTP.'index.php?section=user_response&ak_key='.$ak_key.'">'.LH_MAIN_HTTP.'index.php?section=user_response&ak_key='.$ak_key.'</a><br>
                <br>
                Best regards
                </div>';

                $von = "[email protected]";
                $headers  = "MIME-Version: 1.0\r\n";
                $headers .= "Content-type: text/html; charset=iso-8859-1\r\n";
                //echo $_POST['email'];
                mail($_POST['email'], "Join Community", $content,"From: ".$von."\r\n" ."Reply-To: ".$von."\r\n" . $headers);
                               
                //lh_mail($_POST['email'],$content,true,"Join Wicked Community","[email protected]");   
               
                $db->execute("INSERT INTO lh_member_rank (userID) VALUES ('".$user_id."')");
                $db->execute("INSERT INTO lh_userprofil (userID) VALUES ('".$user_id."')");
                $db->execute("INSERT INTO lh_member_wetten (userID) VALUES ('".$user_id."')");
                $db->execute("INSERT INTO lh_forum_member (user_id) VALUES ('".$user_id."')");   
                $db->execute("INSERT INTO lh_member_pics (user_id) VALUES ('".$user_id."')");   
                $db->execute("INSERT INTO lh_member_avatar (user_id) VALUES ('".$user_id."')");   
                $db->execute("INSERT INTO lh_member_signatur (user_id) VALUES ('".$user_id."')");
                $done = "register";
            }
            else
            {
                top($lhl['error']);
                achtung("MYSQL Fehler");
                nop();
               
            }
        }       
    }
if($done == "register")
{
    erfolg("Sie haben sich erfolgreich regestriert. Sie erhalten in k
 
I always had troubles with mssql connect. I solved them by using ODBC instead. I'm not saying 100% it will fix your problem, but I guess it's worth a try.

-V
 
Upvote 0
Back