![]() |
|
Help Captcha Code - Printable Version +- LCKB (https://lckb.dev/forum) +-- Forum: ** OLD LCKB DATABASE ** (https://lckb.dev/forum/forumdisplay.php?fid=109) +--- Forum: Programmers Gateway (https://lckb.dev/forum/forumdisplay.php?fid=196) +---- Forum: Coders Talk (https://lckb.dev/forum/forumdisplay.php?fid=192) +---- Thread: Help Captcha Code (/showthread.php?tid=1830) |
- crankchaos - 04-14-2013 can one help me do not come with the code is not clear eriner know where the error is allso that will go with it but Captcha <?php if(isset($_SESSION[captcha_spam]) AND $_POST["sicherheitscode"] == $_SESSION[captcha_spam]){ unset($_SESSION[captcha_spam]); } $server = "localhost"; // Your MySQL Server $user = "root"; // Your MySQL User $password = "SQfLhZfnTjd2Wh4A"; // Your MySQL Password $database = "newproject_db_auth"; // Account DB 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 dont match.</font></h2>"; } else echo "<h2><font color=red>You should fill all <b>ã²¥</b> fields!</font></h2>"; } else { echo <h2><font color=red>Der Captcha Code ist falsch!</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= Username style="background-image: url(images/btn.jpg); color: #FFFFFF; width: 260px; height: 34px;"> <h3> Password: </h3> <input type=password class="texta" onkeyup="javascript:this.value=this.value.replace(/[ß,ö,ü,ä,!,§,$,%,&,/,(,),=,-,_,:,;,,.,+,*,°,^,?,´,`,#,@,²,³,{,},\,~,|,<,>,µ]/g, );" name=passwd value=" Password" style="background-image: url(images/btn.jpg); color: #FFFFFF; width: 260px; height: 34px;"> <h3> Password again: </h3> <input type=password class="texta" onkeyup="javascript:this.value=this.value.replace(/[ß,ö,ü,ä,!,§,$,%,&,/,(,),=,-,_,:,;,,.,+,*,°,^,?,´,`,#,@,²,³,{,},\,~,|,<,>,µ]/g, );" name=repeatpasswd value=" Password" style="background-image: url(images/btn.jpg); color: #FFFFFF; width: 260px; height: 34px;"> <h3>Email: </h3> <input type=text class="texta" onkeyup="javascript:this.value=this.value.replace(/[ß,ö,ü,ä,!,§,$,%,&,/,(,),=,-,_,:,;,,+,*,°,^,?,´,`,#,²,³,{,},\,~,|,<,>,µ]/g, );" name=email value= E-Mail style="background-image: url(images/btn.jpg); color: #FFFFFF; width: 260px; height: 34px;"> <br><br> <h3>Captcha Code</h3> <img src="captcha/captcha.php" border="0" title="Sicherheitscode"> <input type="text" name="sicherheitscode" style="background-image: url(images/btn.jpg); color: #FFFFFF; width: 120px; height: 34px;" size="5"> <br><br> <h3><input type=submit name=submit style=padding:3px; font-size:16px; background: url('images/btn.jpg') white; color: gold; shadow: 1px 2px 10px blue; width: 164px; height: 38px; value= Register! > </h3> </table></form></center> Captcha Code : 2 - SmoGG - 04-14-2013 $password = "SQfLhZfnTjd2Wh4A"; // Your MySQL Password Your Password ? O.o - crankchaos - 04-14-2013 is correct is from my home server - crankchaos - 04-14-2013 here you can watch even once 2 - Gothic - 04-16-2013 your problem is the if funktion this is wrong from 2 if(isset($_SESSION[captcha_spam]) AND $_POST["sicherheitscode"] == $_SESSION[captcha_spam]){unset($_SESSION[captcha_spam]); look its jump direkt in the the fals funktion ![]() |