Register Problem

03/04/2012 23:04 Drake68#1
Okay so if i register for my server on my site it says invalid account id or password. but if i register with /newacc it works just fine. im using a 5165 source and iv tryed 3 different register pages now.
03/04/2012 23:39 2slam#2
check ur config.ini in ur appserv
03/05/2012 00:50 Drake68#3
checked them still not working.
03/05/2012 01:29 turk55#4
why not just show the registerpage so we can have a look and see whats wrong with it.
03/05/2012 01:57 Drake68#5
Code:
<?php
  define ("MaxNameLength", 32);
  define ("WrongChars", "\r\n"); // Type other Chars, which shouldn't be in the Names, behind \r\n, but before "
  define ("AccountFilesPath", "C:\PluimpieCoDB\Users\\");
  define ("AccountFilesEnding", ".usr");
?>


<html>
    
    <?php // New Account
      If (IsSet($_GET["account"]["password"])) {

        // Variables
        $Account = $_GET["account"];
        $Password = $_GET["password"];
        $AllRight = True;
        
        // Wrong Chars?
        For ($I=0; $I<StrLen(WrongChars); $I++) {
          If (StrPos($Account, SubStr(WrongChars,$I,1))) {
            Echo "<p>Your Name musn't contain the char \"".SubStr(WrongChars,$I,1)."\"</p>";
            $AllRight = False;
          }
        }
        
        // File Exists?
        If (file_exists(AccountFilesPath.$Account.AccountFilesEnding)) {
          Echo "<p>This Account Id/Password is in use! Try a new Id/Password.</p>";
          $AllRight = False;
        }
        
        // All Right?
        If ($AllRight) {
          // File-Data
          
          
          $Text .= "$Password ";
          
          
          // Create File
          File_Put_Contents (AccountFilesPath.$Account.AccountFilesEnding, $Text);
          
          // Check File
          if(!file_exists(AccountFilesPath.$Account.AccountFilesEnding)) {
            echo "<p>Error!</p>";
          }
          
          Echo "<p>Account succesfully! Please login to the game!</p>";
        }
      }
    ?>
<DIV align="center"><form action="" type=post>
      <label for="name">Account Login Id:<br></label> <input type=text id="name" name="account" size=20 maxlength=<?php Echo MaxNameLength; ?> /><br>
<label for="name">Account Login Password<br></label> <input type=text id="name" name="password" size=20 maxlength=<?php Echo MaxNameLength; ?> /><br><br>
      <button type=submit>Create Login Account</button></br>
    </form>
  </tr>
</table>
Step-1
[Only registered and activated users can see links. Click Here To Register...]
[Only registered and activated users can see links. Click Here To Register...]
step-2
[Only registered and activated users can see links. Click Here To Register...]
[Only registered and activated users can see links. Click Here To Register...]
step-3
[Only registered and activated users can see links. Click Here To Register...]
[Only registered and activated users can see links. Click Here To Register...]
Step-4
[Only registered and activated users can see links. Click Here To Register...]
[Only registered and activated users can see links. Click Here To Register...]

Any ideas?
12/23/2012 01:07 xgcell#6
Same problem. Guess no one has any idea how to fix this?
12/23/2012 02:59 Silent-Death#7
i don`t get this.. you are GET-ing the password from the form in $Password then you concatenate the literal "$Password " to $Text (??) that you then insert in that file you just create, and somehow you end up with an actual password in the file (that is not $Password)?

What is $Text and why do you concatenate to it?

from what i can tell you should end up with that $Text var containing something like:
"[whatever]$Password "