[Question]

03/20/2011 16:27 RT-Gaming#1
Heya, Well im trying to make a register page for newestcoserver..
but I can't connect to it. when I open it in my webbrowers it says:


Username:
Password:
Repeat Password:
3 && strlen($_POST['pass']) < 32) { $sql = "INSERT INTO `tablename` (Table1, Table2) VALUES ('".$_POST['username']."', '".$_POST['pass']."')"; $sql = mysql_query($sql); echo "Registered Successfully"; } else { die("Your password must be between 3 and 32 characters."); } } else { die("Your passwords do not match."); } } else { die("Please enter in a password."); } } ?>

config.ini is ok and I putted it in xampp htdocs..

Could anyone help me please?

thanks
03/20/2011 16:36 Syst3m_W1z4rd#2
You're using a sql register page for a flatfile server.
03/20/2011 18:05 RT-Gaming#3
Oh thanks, so what now??
03/20/2011 18:10 ImFlamedCOD#4
Some times not sure if this is your case or not. If you are using Google Chrome try IE. I noticed like with Hybrids WebServer project of the Manifesto source it did not work well with Chrome. Again not sure if this is the same with your case. From what i have read if my previous stammering not to be true then it lies with your coding.
03/20/2011 19:47 RT-Gaming#5
Hm tried on IE bot not workin,

This is what I Did: I opened the newestcoserver source, and in the folder''Webserver'' were a few files named : register.php registercomplete.php and an index.php. I putted those files in the xampp folder, afterwards I inserted those files on my websites... thats all,, I couldnt find Database name/pass/server/host etc.. just the config.ini ( which is corrected )

thanks
03/20/2011 21:24 onlyme23#6
yo ..just put the source code here ...and we can give you an advice !
Tablename= The name of your table , i think is not "tablename ", i think is accounts or smth like this,
Table1 = Username , i think is not "table1", is user/username.
Table1 = Password , and i think too is not "table2" , is "password"/"pass"
and i think should be :
Code:
if(isset($_POST['submit']))
{
if(!empty($_POST['username']))
{
if(!empty($_POST['pass']))
{
mysql_query("INSERT INTO tablename(Table1, Table2) VALUES ('".$_POST['username']."', '".$_POST['pass']."')");
echo " Registered Succesfully";
}
else
echo "Please provide a password";
}
else 
echo Please provide an username";
}
}
i think you can edit this source code with lenghts and bla bla bla ...and it should work good !
And this is html code :
Code:
<form method="post" action="register.php">
Username <input type="text" name="username" ><br />
Password <input type="text" name="pass" ><br />
<input type="submit" name="submit" value="Register">
</form>
03/20/2011 21:53 RT-Gaming#7
Ohh I dont have tables at all o.0 everything is in folders (oldcodb) .
03/20/2011 23:21 Syst3m_W1z4rd#8
That's what I said in my first post.

You're using a sql register page for a flatfile database.

It won't work at all.
03/21/2011 07:41 RT-Gaming#9
well could you explain me how to make a flatfile?

I got this

Quote:
<?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:\OldCODB\Users\\");
define ("AccountFilesEnding", ".usr");
?>


<html>
<head>
</head>
<body><body bgcolor="Black">
<body text="Red"
<h1><center></center></h1>

<?php // New Account?
if(isset($_POST["account"]["password"])) {
// Variables
$Account = $_POST["account"];
$Password = $_POST["password"];
$Password2 = $_POST["password2"];
$AllRight = True;
if($Password == $Password2){
$NewPass = $Password;
// 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.AccountFile sEnding)) {
Echo "<p>This Account already exists!</p>";
$AllRight = False;
}


// All Right?
If ($AllRight) {


// File-Data
$CrankKey = "CrankCo\n";
$CrankCoPass = "$Password";

$Text .= " $Password ";


// Create File
File_Put_Contents (AccountFilesPath.$Account.AccountFilesEnding, $CrankCoKey); //key
File_Put_Contents (AccountFilesPath.$Account.AccountFilesEnding, $CrankCoPass, FILE_APPEND); //password

// Check File
if(!file_exists(AccountFilesPath.$Account.AccountF ilesEnding)) {
echo "<p>Error!</p>";
}

echo "<p>The account was created succesfully!</p>";
}
}
else
echo "The two passwords you typed are not the same.";
}
?>
<center></FONT>
<form action="" method=post>
<label for="name">Account:<div></label> <input type=text id="name" name="account" size=20 maxlength=10/>
<br>
<label for="name">Password:<div></label> <input type=password id="password" name="password" size=20 maxlength=14/>
<br>
<label for="name">Retype password:<div></label> <input type=password id="password" name="password2" size=20 maxlength=14 />
<br>
<button type="submit">Register</button>
</form>
</body>


</center>
</html>
thanks