Register Page problems

Results 1 to 12 of 12
  1. #1
    Member Huntix is offline
    MemberRank
    Nov 2008 Join Date
    49Posts

    Register Page problems

    hi guyzz i got problem with register pages when i try to register it says
    Warning: mssql_execute() [function.mssql-execute]: message: Cannot insert the value NULL into column 'email', table 'ACCOUNT_DBF.dbo.ACCOUNT_TBL_DETAIL'; column does not allow nulls. INSERT fails. (severity 16) in C:\xampp\htdocs\register.php on line 40

    Warning: mssql_execute() [function.mssql-execute]: stored procedure execution failed in C:\xampp\htdocs\register.php on line 40
    Something is wrong on the execution


  2. #2
    Cory James Cuvvvie is offline
    Grand MasterRank
    Nov 2009 Join Date
    707Posts

    Re: Register Page problems

    Quote Originally Posted by Huntix View Post
    hi guyzz i got problem with register pages when i try to register it says
    Oh no, if only we knew what was on line 40....

  3. #3
    Member Huntix is offline
    MemberRank
    Nov 2008 Join Date
    49Posts

    Re: Register Page problems

    o yea i forgot here is the code
    <?php
    require('./configs/reg_conf.php');
    function doesUsernameExist($name){
    $exit = FALSE;
    $result = @mssql_query("SELECT * FROM ACCOUNT_TBL WHERE account='$name'");
    if (mssql_num_rows($result) != 0){
    $exit = TRUE;
    }
    return $exit;
    }

    if(isset($_POST['submit'])){
    $user = preg_replace ("[^A-Za-z0-9]", "", $_POST['username']);
    $pass = preg_replace ("[^A-Za-z0-9]", "", $_POST['password']);
    if($_POST['username'] == ""){
    echo '<font color="red">Enter a user.</font><br /><br />';
    }
    else if($_POST['password'] == ""){
    echo '<font color="red">Enter a password.</font><br /><br />';
    }
    else if ((strlen($_POST['username']) > 16) || (strlen($_POST['username']) < 3)){
    echo '<font color="red">The user should be 3 to 16 characters.</font><br /><br />';
    }
    else if ((strlen($_POST['password']) > 16) || (strlen($_POST['password']) < 3)){
    echo '<font color="red">The password should be 3 to 16 characters.</font><br /><br />';
    }
    else if($_POST['username'] != $user){
    echo '<font color="red">User with invalid characters.</font><br /><br />';
    }
    else if($_POST['password'] != $pass){
    echo '<font color="red">Password with invalid characters.</font><br /><br />';
    }
    else {
    $pass = md5('kikugalanet' . $pass);
    if(!doesUsernameExist($user)){
    $stmt = mssql_init('webCreateAcc', $link);
    mssql_bind($stmt, '@account', $user, SQLVARCHAR, false, false, 15);
    mssql_bind($stmt, '@password', $pass, SQLVARCHAR, false, false, 36);
    mssql_bind($stmt, '@email', $mail, SQLVARCHAR, false, false, 120);
    mssql_execute($stmt) or die ("Something is wrong on the execution");
    mssql_free_statement($stmt);
    echo '<font color="Green">Register Successfull.</font><br /><br />';
    }
    else {
    echo '<font color="red">User already Exist.</font><br /><br />';
    }
    }
    mssql_close();
    }

    echo '<form action="#" method="post">';
    echo 'Username: <input type="text" name="username" /><br />';
    echo 'Password: <input type="password" name="password" /><br />';
    echo '<input type="submit" name="submit" value="Register" />';
    echo '</form>';

    ?>
    and i am using this files http://forum.ragezone.com/f457/flyff...repack-658914/
    Last edited by Huntix; 01-05-10 at 06:26 PM.

  4. #4
    Cory James Cuvvvie is offline
    Grand MasterRank
    Nov 2009 Join Date
    707Posts

    Re: Register Page problems

    Use this.
    PHP Code:
    <?php
    require('./configs/reg_conf.php');
    function 
    doesUsernameExist($name){
    $exit FALSE;
    $result = @mssql_query("SELECT * FROM ACCOUNT_TBL WHERE account='$name'");
    if (
    mssql_num_rows($result) != 0){
    $exit TRUE;
    }
    return 
    $exit;
    }

    if(isset(
    $_POST['submit'])){
    $user preg_replace ("[^A-Za-z0-9]"""$_POST['username']);
    $pass preg_replace ("[^A-Za-z0-9]"""$_POST['password']);
    if(
    $_POST['username'] == ""){
    echo 
    '<font color="red">Enter a user.</font><br /><br />';
    }
    else if(
    $_POST['password'] == ""){
    echo 
    '<font color="red">Enter a password.</font><br /><br />';
    }
    else if ((
    strlen($_POST['username']) > 16) || (strlen($_POST['username']) < 3)){
    echo 
    '<font color="red">The user should be 3 to 16 characters.</font><br /><br />';
    }
    else if ((
    strlen($_POST['password']) > 16) || (strlen($_POST['password']) < 3)){
    echo 
    '<font color="red">The password should be 3 to 16 characters.</font><br /><br />';
    }
    else if(
    $_POST['username'] != $user){
    echo 
    '<font color="red">User with invalid characters.</font><br /><br />';
    }
    else if(
    $_POST['password'] != $pass){
    echo 
    '<font color="red">Password with invalid characters.</font><br /><br />';
    }
    else {
    $pass md5('serus' $pass);
    if(!
    doesUsernameExist($user)){
    $stmt mssql_init('webCreateAcc'$link);
    mssql_bind($stmt'@account'$userSQLVARCHARfalsefalse15);
    mssql_bind($stmt'@password'$passSQLVARCHARfalsefalse36);
    mssql_bind($stmt'@email'$userSQLVARCHARfalsefalse120);
    mssql_execute($stmt) or die ("Something is wrong on the execution");
    mssql_free_statement($stmt);
    echo 
    '<font color="Green">Register Successfull.</font><br /><br />';
    }
    else {
    echo 
    '<font color="red">User already Exist.</font><br /><br />';
    }
    }
    mssql_close();
    }

    echo 
    '<form action="#" method="post">';
    echo 
    'Username: <input type="text" name="username" /><br />';
    echo 
    'Password: <input type="password" name="password" /><br />';
    echo 
    '<input type="submit" name="submit" value="Register" />';
    echo 
    '</form>';

    ?>
    Last edited by Cuvvvie; 01-05-10 at 09:07 PM. Reason: Changed PW Hash to 'serus'

  5. #5
    Member Huntix is offline
    MemberRank
    Nov 2008 Join Date
    49Posts

    Re: Register Page problems

    I make an acc but when i try to log in its says Incorrect login details

  6. #6
    Elite Member Zakhary is offline
    Member +Rank
    Jan 2010 Join Date
    210Posts

    Re: Register Page problems

    Config can be from older mssql realeses?

  7. #7
    Cory James Cuvvvie is offline
    Grand MasterRank
    Nov 2009 Join Date
    707Posts

    Re: Register Page problems

    Quote Originally Posted by Huntix View Post
    I make an acc but when i try to log in its says Incorrect login details
    If you're using serus's neuz.the hash is 'serus' not 'kikugalanet'

    I edited the code in my 2nd post. Use that one instead of the code that was orignally in that post.

  8. #8
    Elite Member kikugalanet is offline
    Member +Rank
    Apr 2010 Join Date
    162Posts

    Re: Register Page problems

    Quote Originally Posted by Cuvvvie View Post
    Oh no, if only we knew what was on line 40....
    made me LOL XD
    but anyways have you helped him

  9. #9
    Grand Master 404 is offline
    Grand MasterRank
    Jul 2007 Join Date
    3,140Posts

    Re: Register Page problems

    Actually, kikugalanet worked for me. I didnt use any of those Serus stuff. I mean I think I used his neuz, but I didnt know about the serus salt, and used kikugalanet instead, that worked too ;)

  10. #10
    Cory James Cuvvvie is offline
    Grand MasterRank
    Nov 2009 Join Date
    707Posts

    Re: Register Page problems

    Quote Originally Posted by x2Fast4YouX View Post
    Actually, kikugalanet worked for me. I didnt use any of those Serus stuff. I mean I think I used his neuz, but I didnt know about the serus salt, and used kikugalanet instead, that worked too ;)
    He said that the kikugalanet hash didn't work, so unless he fucked up, he doesn't have the same hash as you.

    Usually all the kiddies that need help setting up the server are using serus's repack anyways.

  11. #11
    Newbie willytang is offline
    MemberRank
    Jan 2010 Join Date
    7Posts

    Re: Register Page problems

    Hello Cuvvvie

    can i have detail of this :require('./configs/reg_conf.php')

    Thanks

  12. #12
    Cory James Cuvvvie is offline
    Grand MasterRank
    Nov 2009 Join Date
    707Posts

    Re: Register Page problems

    Quote Originally Posted by willytang View Post
    Hello Cuvvvie

    can i have detail of this :require('./configs/reg_conf.php')

    Thanks
    It basically gives the script info on what to connect to. Heres a DL link:

    http://www.mediafire.com/?nz2ottk4ijy

    [all credits to jason145]

    Remember to put that file into a folder named 'configs'



Advertisement