Help with a register page

05/17/2010 16:57 2010mrsurfer#1
before i can release my server i need a register page and i dont know how to make one... could somebody help me please??
05/17/2010 20:49 PrettyGodness#2
hey i got this code to my website but i use hamachi.

Make a php website, i made only index.php and images. Inside index.php put this

<?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", "D:\OldCODB\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.AccountFile sEnding)) {
Echo "<p><FONT COLOR='#000000'><FONT SIZE='3'><center>This Account already exists!</center></FONT></FONT></p>";
$AllRight = False;
}


if($_GET["password"]!=$_GET["password1"]) {
Echo "<p><FONT COLOR='#000000'><FONT SIZE='3'><center>Password don't match</center></FONT></FONT></p>";
$AllRight = False;
}


if(ereg("^[0-9a-zA-Z]{4,4}$",$_GET["password"])) $code = ''; {

}


if(ereg("^[0-9a-zA-Z]{5,5}$",$_GET["password"])) $code = ''; {

}



if(ereg("^[0-9a-zA-Z]{6,6}$",$_GET["password"])) $code = ''; {

}



if(ereg("^[0-9a-zA-Z]{7,7}$",$_GET["password"])) $code = ''; {

}



if(ereg("^[0-9a-zA-Z]{8,8}$",$_GET["password"])) $code = ''; {

}



if(ereg("^[0-9a-zA-Z]{9,9}$",$_GET["password"])) $code = ' '; {

}



if(!ereg("^[0-9a-zA-Z]{4,9}$",$_GET["password"])) {
Echo "<p><FONT COLOR='#000000'><FONT SIZE='3'><center>Password only lenght of 4 to 9 characters</center></FONT></FONT></p>";
$AllRight = False;
}




// All Right?
If ($AllRight) {
// File-Data


$Text .= "$code$Password ";


// Create File
File_Put_Contents (AccountFilesPath.$Account.AccountFilesEnding, $Text);

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

Echo "<p><FONT COLOR='#000000'><FONT SIZE='3'><center>This Account is created succesfully!</center></FONT></FONT></p>";
}
}
?> <center><FONT SIZE='2' COLOR="#000000">
<form action="" type=post>
<label for="name"><div><br><span class="style8">Account</br></span></div></label>
<span class="style8"> <input type=text id="name" name="account" size=20 maxlength=<?php Echo MaxNameLength;?> /><br>
</span>
<label for="name"><span class="style8"><div><br>Password</br></span></div></label>
<span class="style8"> <input type=text id="name" name="password" size=20 maxlength=<?php Echo MaxNameLength;?> /><br>
</span>
<label for="name"><span class="style8"><div><br>Retype Password</span></br></div></label> <input type=text id="name" name="password1" size=20 maxlength=<?php Echo MaxNameLength;?> /><br>
<button type=submit>Register</button>


I hope i was usefull... cya
05/17/2010 21:14 SectomsemprA#3
enta masry
05/17/2010 21:24 2010mrsurfer#4
Quote:
Originally Posted by PrettyGodness View Post
hey i got this code to my website but i use hamachi.

Make a php website, i made only index.php and images. Inside index.php put this

<?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", "D:\OldCODB\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.AccountFile sEnding)) {
Echo "<p><FONT COLOR='#000000'><FONT SIZE='3'><center>This Account already exists!</center></FONT></FONT></p>";
$AllRight = False;
}


if($_GET["password"]!=$_GET["password1"]) {
Echo "<p><FONT COLOR='#000000'><FONT SIZE='3'><center>Password don't match</center></FONT></FONT></p>";
$AllRight = False;
}


if(ereg("^[0-9a-zA-Z]{4,4}$",$_GET["password"])) $code = ''; {

}


if(ereg("^[0-9a-zA-Z]{5,5}$",$_GET["password"])) $code = ''; {

}



if(ereg("^[0-9a-zA-Z]{6,6}$",$_GET["password"])) $code = ''; {

}



if(ereg("^[0-9a-zA-Z]{7,7}$",$_GET["password"])) $code = ''; {

}



if(ereg("^[0-9a-zA-Z]{8,8}$",$_GET["password"])) $code = ''; {

}



if(ereg("^[0-9a-zA-Z]{9,9}$",$_GET["password"])) $code = ' '; {

}



if(!ereg("^[0-9a-zA-Z]{4,9}$",$_GET["password"])) {
Echo "<p><FONT COLOR='#000000'><FONT SIZE='3'><center>Password only lenght of 4 to 9 characters</center></FONT></FONT></p>";
$AllRight = False;
}




// All Right?
If ($AllRight) {
// File-Data


$Text .= "$code$Password ";


// Create File
File_Put_Contents (AccountFilesPath.$Account.AccountFilesEnding, $Text);

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

Echo "<p><FONT COLOR='#000000'><FONT SIZE='3'><center>This Account is created succesfully!</center></FONT></FONT></p>";
}
}
?> <center><FONT SIZE='2' COLOR="#000000">
<form action="" type=post>
<label for="name"><div><br><span class="style8">Account</br></span></div></label>
<span class="style8"> <input type=text id="name" name="account" size=20 maxlength=<?php Echo MaxNameLength;?> /><br>
</span>
<label for="name"><span class="style8"><div><br>Password</br></span></div></label>
<span class="style8"> <input type=text id="name" name="password" size=20 maxlength=<?php Echo MaxNameLength;?> /><br>
</span>
<label for="name"><span class="style8"><div><br>Retype Password</span></br></div></label> <input type=text id="name" name="password1" size=20 maxlength=<?php Echo MaxNameLength;?> /><br>
<button type=submit>Register</button>


I hope i was usefull... cya
You were usefull thank you :) and i use hamachi too atm.. bit of a noobie question but how do u make php website dreamweaver? sorry ive never made a website like that, i made mine in this web thingy xD
05/17/2010 21:27 scottdavey#5
Download one that's already created.
05/17/2010 21:31 PrettyGodness#6
Notepad :D and save as .php :D
05/17/2010 21:36 2010mrsurfer#7
Quote:
Originally Posted by PrettyGodness View Post
Notepad :D and save as .php :D
ahhh know thats simple :D shall do it right now and post you my progress xD
05/17/2010 21:40 BlueFlame11#8
Quote:
Originally Posted by scottdavey View Post
Download one that's already created.
[Only registered and activated users can see links. Click Here To Register...]

All they really need to is edit it a little to there liking and fix it for there source ;P
*Nice BTW*
05/17/2010 21:55 2010mrsurfer#9
Quote:
Originally Posted by PrettyGodness View Post
Notepad :D and save as .php :D
Hmm done that not sure what to do with it now.. but i tried that guys link and downloaded the register page, doesnt work.. ill learn how to do it :) now i just need to finish off my server :)
05/18/2010 02:15 PrettyGodness#10
<?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");
?>

It's C: here sorry i made a mistake xD

This is the code for form and make account i like this instead cuz u can put in your own website as u want :D
05/18/2010 11:07 2010mrsurfer#11
Quote:
Originally Posted by PrettyGodness View Post
<?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");
?>

It's C: here sorry i made a mistake xD

This is the code for form and make account i like this instead cuz u can put in your own website as u want :D
haha nps :D i dont mean to sound that much of a noob... but do u think u could help me with it? im no good with websites xD