![]() |
|
Safe Register Script - Printable Version +- LCKB (https://lckb.dev/forum) +-- Forum: ** OLD LCKB DATABASE ** (https://lckb.dev/forum/forumdisplay.php?fid=109) +--- Forum: Website Scripting & Security (https://lckb.dev/forum/forumdisplay.php?fid=197) +---- Forum: Website Releases (https://lckb.dev/forum/forumdisplay.php?fid=135) +----- Forum: Ep1 Websites (https://lckb.dev/forum/forumdisplay.php?fid=185) +----- Thread: Safe Register Script (/showthread.php?tid=1188) Pages:
1
2
|
- Whazzert...♥ - 10-13-2012 Here is a safe register script ! Credizz -Me -Rama [hide] 2 [/hide] - =Anonymous= - 10-13-2012 Yet credits to Damona. My here is only design (because in DamonA`s was green font and black bg, it isn't nice) - vladbon - 10-13-2012 - -S-y...? - 10-13-2012 <?php ##################################################### # LcDevClub # ##################################################### $server = "localhost"; $user = "root"; $password = ""; $database = "newproject_db_auth"; function clean($str) {$str = @trim($str); if(get_magic_quotes_gpc()) { $str = stripslashes($str); } return @mysql_escape_string($str); } $submit = strip_tags(@$_POST ['submit']) ; $user_id = clean(strip_tags(@$_POST ['user_id'])) ; $passwd = clean(strip_tags(@$_POST ['passwd'])) ; $repeatpasswd = clean(strip_tags(@$_POST ['repeatpasswd'])) ; $email = strip_tags(@$_POST ['email']) ; if ($submit) { if ($user_id&&$passwd&&$repeatpasswd&&$email) { if ($passwd==$repeatpasswd) { $link = mysql_connect( "$server","$user","$password"); if(!$link) { die('ÃÂÃ¥ óäàëîñü ïîäêëþ÷èòüñÿ ê ñåðâåðó: ' . mysql_error()); } $db = mysql_select_db("$database"); if(!$db) { die("Cannot connecto to database/"); } mysql_query("set names 'UTF8'"); if($user_id != '') { $qry = "SELECT * FROM bg_user WHERE user_id = '$user_id'"; $result = mysql_query($qry); if($result) { if(mysql_num_rows($result) > 0) { echo "<font color=red> <h2>Username already taken.</font></h2>"; } else { if (strlen($user_id)>15||strlen($email)>30) { echo "<h2><font color=red>Login or Email is very long.</font></h2>"; } else { if (strlen($passwd)>15||strlen($passwd)<6) { echo "<h2><font color=red>Password must be have 3-15 symbols.</font></h2>"; } else { $queryreg = mysql_query("INSERT INTO bg_user (user_id, passwd, email) VALUES ('$user_id', '$passwd', '$email')"); echo "<h2><font color=green>Successfully.</font></h2>"; } } } } } } else echo "<h2><font color=red>Passwords don't match.</font></h2>"; } else echo "<h2><font color=red>You should fill all <b>âñå</b> fields!</font></h2>"; } ?> <form action='register.php' method='POST'> <table> <h3>Username: </h3 > <input type='text' class="texta" onkeyup="javascript:this.value=this.value.replace(/[ß,ö,ü,ä,!,§,$,%,&,/,(,),=,-,_,:,;,',.,+,*,°,^,?,´,`,#,@,²,³,{,},\,~,|,<,>,µ]/g, '');" name='user_id' value='<?php echo $user_id ?>'> <h3>Password: </h3> <input type='password' class="texta" onkeyup="javascript:this.value=this.value.replace(/[ß,ö,ü,ä,!,§,$,%,&,/,(,),=,-,_,:,;,',.,+,*,°,^,?,´,`,#,@,²,³,{,},\,~,|,<,>,µ]/g, '');" name='passwd'> <h3>Password again: </h4> <input type='password' class="texta" onkeyup="javascript:this.value=this.value.replace(/[ß,ö,ü,ä,!,§,$,%,&,/,(,),=,-,_,:,;,',.,+,*,°,^,?,´,`,#,@,²,³,{,},\,~,|,<,>,µ]/g, '');" name='repeatpasswd'> <h3>Email: </h3> <input type='text' class="texta" onkeyup="javascript:this.value=this.value.replace(/[ß,ö,ü,ä,!,§,$,%,&,/,(,),=,-,_,:,;,',+,*,°,^,?,´,`,#,²,³,{,},\,~,|,<,>,µ]/g, '');" name='email' value='<?php echo $email ?>'> <h3> <input type='submit' class="buttonz" name='submit' style='padding:3px; padding-right: 3px; font-size:16px; background: white; color: black; shadow: 1px 2px 10px blue; ' value=' Register! '> </h3> </table> </form> - Whazzert...♥ - 10-13-2012 Cool# -.- - xROCKSTARx - 10-13-2012 Nice, ty - Wizatek - 10-14-2012 [] - Anja - 10-18-2012 23 - EiSyntax - 10-21-2012 Thx - Dimensions - 10-21-2012 ... |