| Neuer Benutzer
Registriert seit: 31.03.2008
Beiträge: 6
| Ok hir sind die codes
captcha.php PHP-Code: <? /* Captcha v1.o8 - Copyright (c) 2006, Daniel Kauser aka danysahne333 This program and it's moduls are Open Source in terms of General Public License (GPL) v2.0 captcha.php (random text module) visit http://www.cb-talk.de/captcha.html for latest version */ // Alle Fehler und Notices anzeigen error_reporting(E_ALL); session_start(); $CAPTCHA_TempString=""; // Zufallsfunktion für Zahlen und Buchstaben function GetRandomChar() { // Zufallszahl generieren mt_srand((double)microtime()*1000000); $CAPTCHA_RandVal = mt_rand(1,3); // Buchstabensalat generieren jeh nachdem ob Randval 1 oder 2 ist switch ($CAPTCHA_RandVal) { case 1: // Zahlen 0-9 $CAPTCHA_RandVal = mt_rand(48, 57); break; case 2: // Grosse Buchstaben $CAPTCHA_RandVal = mt_rand(65, 90); break; case 3: // Kleine Buchstaben $CAPTCHA_RandVal = mt_rand(97, 122); break; } // Zufallscode ausgeben return chr($CAPTCHA_RandVal); } // Zufallscode x-stellig ausgeben for ($i = 1; $i <= 6; $i++) { $CAPTCHA_TempString .= GetRandomChar(); } // Text in Sessionvariable speichern if (isset($CAPTCHA_TempString)) { $_SESSION["CAPTCHA_RndText"] = str_replace('I','E',str_replace('0','3',str_replace('1','S',str_replace('B','F',str_replace('O','P',str_replace('4','A',str_replace('D','K',$CAPTCHA_TempString))))))); } else { die("Zufallscode konnte nicht generiert werden!"); } ?> <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> <html xmlns="http://www.w3.org/1999/xhtml" xml:lang="de" lang="de"> <head> <meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" /> <meta http-equiv="language" content="de" /> <title>captcha.php</title> </head> <body> <h3>Captcha 1.0.8</h3> <form method="post" action="captcha_ausw.php" name="sms"> <div> <p class="abstand3">Please enter correct code here. </p> <p class="abstand3"><img border="0" src="captcha_img.php" alt="" /></p> <p class="abstand">Code: <input maxlength="6" name="txtCode" size="28" type="text" /></p> <p class="abstand"><input class="button" type="submit" name="eintrag" value="eintragen" /> <input class="button" type="reset" name="reset" value="löschen" /></p> </div> </form> </body> </html> und dan
captcha_ausw.php PHP-Code: <? // Alle Fehler und Notices anzeigen error_reporting(E_ALL); session_start(); // Bei Ausgabe des eingegebenen Codes müssen html tags entfernt werden! $CAPTCHA_RandomText = ""; if (isset($_POST['txtCode'])){ $CAPTCHA_EnteredText = str_replace("<","",str_replace(">","",str_replace("'","",str_replace("[","",str_replace("]","",$_POST['txtCode']))))); } if (isset($_SESSION['CAPTCHA_RndText'])) { $CAPTCHA_RandomText = $_SESSION['CAPTCHA_RndText']; } if ($CAPTCHA_EnteredText == $CAPTCHA_RandomText and isset($_POST['txtCode']) == true and isset($_SESSION['CAPTCHA_RndText'])){ // Hier Code, wenn Übereinstimmung echo "<h3>Gratulation!</h3>"; echo "Right Code!"; echo "Your Code: $CAPTCHA_EnteredText, Random Code: $CAPTCHA_RandomText"; } else { // Hier Code wenn keine Übereinstimmung echo "<h3>Nope!</h3>"; echo "Wrong Code!"; echo "Your Code: $CAPTCHA_EnteredText, Random Code: $CAPTCHA_RandomText"; } echo "<br />"; echo "<a href=\"captcha.php\">do it again!</a>"; // Session unset und destroy session_unset(); session_destroy(); ?> und dan
captcha_img PHP-Code: <?php // Alle Fehler und Notices anzeigen error_reporting(E_ALL); /* Captcha v1.o8 - Copyright (c) 2006, Daniel Kauser aka danysahne333 This program and it's moduls are Open Source in terms of General Public License (GPL) v2.0 captcha_img.php (image module) visit http://www.cb-talk.de/captcha.html for latest version */ // Session initialisieren session_start(); $imid=$_GET['imid']; // Benötigte Files laden! Hier kann editiert werden! $imagettftext = "1"; // Alternative Grafik-Zeichenfunktion nutzen? (bei fehlerhafter Darstellung // oder fehlendem Truetype-support) 1=nein, 2=ja $Welleneffekt = "1"; // Welleneffekt nutzen? 1=nein, 2=ja $Textgroesse = "32"; $Texthoehe = "47"; $Schriftart = "captcha_files/truetype.ttf"; $bg1 = "captcha_files/background2.png"; $bg2 = "captcha_files/background2.png"; $ov1 = "captcha_files/overlay2.png"; $ov2 = "captcha_files/overlay2.png"; // Benötige Strings überprüfen if (isset($_SESSION["CAPTCHA_RndText"])) { $CAPTCHA_RandomText = $_SESSION["CAPTCHA_RndText"]; } else { // Fehlermeldung ausgeben header ("Content-type: image/png"); $im[$imid] = @imagecreatetruecolor(300, 30) or die("Cannot Initialize new GD image stream"); $text_color = imagecolorallocate($im[$imid], 233, 14, 91); imagestring($im[$imid], 10, 5, 7, "Kein Zufallscode übergeben!", $text_color); imagepng($im[$imid]); imagedestroy($im[$imid]); exit(); } // Auf Funktion überprüfen if ($imagettftext == "1") { // Benötige Files überprüfen if (!file_exists($Schriftart)) { // Fehlermeldung ausgeben // header ("Content-type: image/png"); $im[$imid] = @imagecreatetruecolor(300, 30) or die("Cannot Initialize new GD image stream"); $text_color = imagecolorallocate($im[$imid], 233, 14, 91); imagestring($im[$imid], 10, 5, 7, "Schriftart nicht gefunden!", $text_color); imagepng($im[$imid]); imagedestroy($im[$imid]); exit(); } if (!file_exists($bg1) OR !file_exists($bg2)) { // Fehlermeldung ausgeben header ("Content-type: image/png"); $im[$imid] = @imagecreatetruecolor(300, 30) or die("Cannot Initialize new GD image stream"); $text_color = imagecolorallocate($im[$imid], 233, 14, 91); imagestring($im[$imid], 10, 5, 7, "Hintergrundbild nicht gefunden!", $text_color); imagepng($im[$imid]); imagedestroy($im[$imid]); exit(); } if (!file_exists($ov1) OR !file_exists($ov2)) { // Fehlermeldung ausgeben header ("Content-type: image/png"); $im[$imid] = @imagecreatetruecolor(300, 30) or die("Cannot Initialize new GD image stream"); $text_color = imagecolorallocate($im[$imid], 233, 14, 91); imagestring($im[$imid], 10, 5, 7, "Overlaybild nicht gefunden!", $text_color); imagepng($im[$imid]); imagedestroy($im[$imid]); exit(); } // Zufallshintergrund mt_srand((double)microtime()*1000000); $Bild1 = mt_rand(1, 2); switch ($Bild1) { case 1: $Grafik[$imid]=imagecreatefrompng($bg1); $Grafikhilf=imagecreatefrompng($bg1); break 1; case 2: $Grafik[$imid]=imagecreatefrompng($bg2); $Grafikhilf=imagecreatefrompng($bg2); break 1; } // Zufallsgrafik2 mt_srand((double)microtime()*1000000); $Bild2 = mt_rand(1, 2); switch ($Bild2) { case 1: $Grafik2=imagecreatefrompng($ov1); break 1; case 2: $Grafik2=imagecreatefrompng($ov2); break 1; } // Textfarben ins Array speichern $textfarbe = array( imagecolorallocate($Grafik[$imid], 128, 128, 128), imagecolorallocate($Grafik[$imid], 0, 0, 0), imagecolorallocate($Grafik[$imid], 50, 171, 4), imagecolorallocate($Grafik[$imid], 128, 0, 128), imagecolorallocate($Grafik[$imid], 128, 128, 255), imagecolorallocate($Grafik[$imid], 255, 128, 128), imagecolorallocate($Grafik[$imid], 192, 122, 0), imagecolorallocate($Grafik[$imid], 250, 94, 250), imagecolorallocate($Grafik[$imid], 122, 146, 224), imagecolorallocate($Grafik[$imid], 122, 155, 180) ); // Text auf das Bild schreiben imagettftext($Grafik[$imid], $Textgroesse, mt_rand(-13, 13), 10, $Texthoehe+mt_rand(-7,8), $Textfarbe1 = $textfarbe[array_rand($textfarbe)] , $Schriftart, $CAPTCHA_RandomText[0]); imagettftext($Grafik[$imid], $Textgroesse, mt_rand(-13, 13), 45, $Texthoehe+mt_rand(-7,8), $Textfarbe2 = $textfarbe[array_rand($textfarbe)] , $Schriftart, $CAPTCHA_RandomText[1]); imagettftext($Grafik[$imid], $Textgroesse, mt_rand(-13, 13), 80, $Texthoehe+mt_rand(-7,8), $Textfarbe3 = $textfarbe[array_rand($textfarbe)] , $Schriftart, $CAPTCHA_RandomText[2]); imagettftext($Grafik[$imid], $Textgroesse, mt_rand(-13, 13), 113, $Texthoehe+mt_rand(-7,8), $Textfarbe4 = $textfarbe[array_rand($textfarbe)] , $Schriftart, $CAPTCHA_RandomText[3]); imagettftext($Grafik[$imid], $Textgroesse, mt_rand(-13, 13), 150, $Texthoehe+mt_rand(-7,8), $Textfarbe5 = $textfarbe[array_rand($textfarbe)] , $Schriftart, $CAPTCHA_RandomText[4]); imagettftext($Grafik[$imid], $Textgroesse, mt_rand(-13, 13), 191, $Texthoehe+mt_rand(-7,8), $Textfarbe6 = $textfarbe[array_rand($textfarbe)] , $Schriftart, $CAPTCHA_RandomText[5]); if ($Welleneffekt == "2") { $stauchung = mt_rand(0,100)/400+0.10; $Grafikalt = $Grafik[$imid]; $Grafik[$imid] = $Grafikhilf; for ($i=1;$i<=65;$i++){ imagecopy($Grafik[$imid], $Grafikalt, round((sin($i*$stauchung)*2))+3, $i, 1, $i, 230,1); } } // Transparente Grafik drüberlegen imagecopy($Grafik[$imid], $Grafik2, 0, 0, 0, 0, 230, 65); // Bild ausgeben header("Content-type: image/png"); imagepng($Grafik[$imid]); imagedestroy($Grafik[$imid]); } else if ($imagettftext == "2") { // Alternativbild ausgeben header ("Content-type: image/png"); $im[$imid] = @imagecreatetruecolor(70, 30) or die("Cannot Initialize new GD image stream"); $text_color = imagecolorallocate($im[$imid], 255, 255, 255); imagestring($im[$imid], 10, 5, 7, $CAPTCHA_RandomText, $text_color); imagepng($im[$imid]); imagedestroy($im[$imid]); } else { // Fehlermeldung ausgeben header ("Content-type: image/png"); $im[$imid] = @imagecreatetruecolor(430, 30) or die("Cannot Initialize new GD image stream"); $text_color = imagecolorallocate($im[$imid], 233, 14, 91); imagestring($im[$imid], 10, 5, 7, "Fehlerhafte Auswahl($imagettftext)der Funktion! (1 od. 2)", $text_color); imagepng($im[$imid]); imagedestroy($im[$imid]); exit(); } ?>
und dan habe ich im autoreg.php noch codes
und im autoreg_best und autoreg_check habe ich auch noch codes dafon drine ich denke mal das die dafür da sind das der captcha auf der seite angezeigt wird
ich habe auch schon dem coder gechriben der den gecodet hatt nur er antwortet kaum und ist meinst nie on allso denke ich mir mal das ich von im keine hilfe erwarten kann
MFG
Oerny18
Geändert von oerny18 (31.03.2008 um 16:27 Uhr).
|