Captcha nem akar működni a vendégkönyvemben.

Ez a téma lezárásra került a moderátor által. A lezárás oka: 1 t�ma - 1 k�rd�s
Captcha nem akar működni a vendégkönyvemben.
2012-12-06T21:24:12+01:00
2012-12-08T08:22:02+01:00
2022-11-27T15:40:45+01:00
Suborka
Sziasztok! Volna egy problémám, a Chaptcha-val kapcsolatban. Van egy vendégkönyvem és tökéletesen működik is, de szeretném a Spam-ek által védeni, captcha-val, de valamiért nem hajtódik végre, és van egy header problémám is amivel nem tudok mit kezdeni. Tud valaki segíteni? Köszönöm!

Kód:

<?php $version = "1.2.02"; $spamblock=array( "porn", "viagra", ); /********************************** * Configuration Step 1 : Language * **********************************/ // Please remove all the unwanted language blocks //ENGLISH $langAdminError = "Administrator Error"; $langBsGuestbook = "Fórum"; $langChPassword = "Change Password"; $langEmail = "E-mail:"; $langEntry = "Entry"; $langGbAdmin = "Guestbook Administration"; $langMessage = "Üzenet:"; $langName = "Név:"; $langnewPassword = "New Password :"; $langOpenError = "Error opening file !<br>Be sure writing is allowed in this directory."; $langPassChanged = "The password has been changed."; $langPassError = "The new passwords don't match !"; $langPassword = "Change <i></i> Password"; $langRetype = "Retype new Password :"; $langSubmit = "Mehet"; $langSubmitModif = "Submit Modifications"; $langSystemError = "System Error"; $langSystemMessage = "System Message"; $langWrongPassword = "Wrong Admin Password"; /******************************************* * Configuration Step 2 : Carbon Copy Email * *******************************************/ // carbonCopy = 1 enables mail sending to mailRecipient. // mailRecipient receives a mail each times an entry is entered (if carbonCopy = 1) // mailSubject is the subject of the mail which is sent. $carbonCopy = 0; $mailRecipient = "your.mail@your.isp"; $mailSubject = "[] New Guestbook Entry"; /******************************** * Configuration Step 3 : Colors * ********************************/ // Choosing colors (Remove the unwanted color-model) /* // Standard (Greys, bright background) $colorWhite = ""#000000""; $colorBlack = ""#000000""; $colorHeads = ""#000000""; $colorBody1 = ""#0FC7FF""; $colorBody2 = ""#000000""; */ // The Following is the standard $colorWhite = ""#333333""; $colorBlack = ""#333333""; $colorHeads = ""#333333""; $colorBody1 = ""#606060""; $colorBody2 = ""#767676""; // Data submission form colors $formHeadColor = $colorHeads; $formBodyColor = $colorBody1; $formTailColor = $colorBody2; $formHeadText = $colorWhite; $formBodyText = $colorBlack; // Guestbook entries colors $entryHeadColor = $colorHeads; $entryBodyColor1 = $colorBody2; $entryBodyColor2 = $colorBody1; $entryHeadText = $colorWhite; $entryBodyText1 = $colorBlack; $entryBodyText2 = $colorHeads; // Messages colors $adminHeadColor = $colorHeads; $adminHeadText = $colorWhite; $adminBodyColor1 = $colorBody2; $adminBodyText1 = $colorBlack; $adminBodyColor2 = $colorBody1; $adminBodyText2 = $colorHeads; /******************************** * Configuration Step 4 : Header * ********************************/ function displayHeader() { global $version; header ("Expires: Sat, 01 Jan 2000 00:00:00 GMT"); ?> <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN"> <HTML> <HEAD> <title>Vengédkönyv</title> <meta http-equiv="Content-Type" content="text/html; charset=iso-8859-2"> <meta http-equiv="Content-Language" content="hu"> <meta name="robots" content="all"> </HEAD> <BODY> <?php // You migh use an "include" (or a "require") instead of all this : // include ("head.inc"); } /******************************** * Configuration Step 5 : Footer * ********************************/ function displayFooter() { ?> </BODY> </HTML> <?php } /****************************************************** * Configuration Step 6 : Number of messages displayed * ******************************************************/ // Number of fields to be displayed simultaneously. // To display everything, set $displayStep to 0. $displayStep = 100; //Added remote IP tracking - Mark L Shaw - 21/April/2004 $ip=$_SERVER['REMOTE_ADDR']; /*********************************************** * Configuration Step 7 : Allow AutoLink System * ***********************************************/ // Allows URLs ans E-Mails in Guestbook text to be replaced by HTTP links. $allowAutoLink=1; // Replaces every "@" in text by "at". (to avoid Spam) $at_replace=true; /****************************************** * Configuration Step 8 : Register_Globals * ******************************************/ // Register_Globals improvements (since version 1.2.0) // By Hubert Hanghofer (webmaster at BierIG dot org) // $absoluteScriptPath is the name of the current script (this file) and which // is going to be modified by itself. This means that (theoretically) this file // can be placed anywhere on the system, with any fileName. // Choose one of the following sections to be used. (These are environment // variables, which could be different with the PHP version you're using) $displayBegin = $_GET['displayBegin']; // We definitely missed this, thanks Shimona ! // Environment Variables for PHP, older versions $absoluteScriptPath = $PATH_TRANSLATED; // $SCRIPT_FILENAME might be used instead $relativeScriptPath = $PHP_SELF; $refererpage = $HTTP_REFERER; /* // Environment Variables for PHP, newer versions $absoluteScriptPath = $_SERVER["PATH_TRANSLATED"]; // "SCRIPT_FILENAME" might be used instead $relativeScriptPath = $_SERVER["PHP_SELF"]; $refererpage = $_SERVER["HTTP_REFERER"]; */ /************************ * End of Configuration * ************************/ // When the php preprocessor is installed as an independant binary (as CGI). if ($PATH_INFO!="") { $relativeScriptPath = $PATH_INFO; } // To be used when $PHP_SELF contains virtual directory reference // (for multi-users servers, eg : free.fr, online.fr ...) if (($SERVER_NAME=="php.proxad.net")||(($SERVER_NAME=="php3.pro.proxad.net"))) { $relativeScriptPath = substr($relativeScriptPath, strpos(substr($relativeScriptPath, 1), "/")+1); } $theName=substr($absoluteScriptPath, 0, strrpos($absoluteScriptPath, ".")); $extension=substr($absoluteScriptPath, strrpos($absoluteScriptPath, ".")+1); // The dataFile contains all the guestbook entries, and $adminpassword . // $adminpassword is the password which will be asked for any administration // actions. This password could be changed only if in admin mode (old // $adminpassword matches $admin). // Defines the name of the database file where the entries are stored. $dataFile = "index.dat.php"; //****************************************************************************** // function displayForm : Display the form which enables the client to type a // message. // CAPTCHA KEZDETE session_start(); //Start the session $session = $_SESSION['captcha']; //Define the session we set in image.php $image = $_POST['image']; //Define the post $image = md5($image); //MD5 encrypt the post if ($session == $image){ //if they have put the right text in }else{ echo "Hibás biztonsági kód! <br><br> <a href='javascript:history.back()'>&lt;&lt; Vissza!</a>"; } // CAPTCHA VEGE if(isset($spamblock)) /* If you have defined */ { $spamblock=join("|",$spamblock); if(preg_match("/(".$spamblock.")/i",$_POST['message'])) { echo "<center><b>Stop!</b></center>"; //Add IP blocking code here die(); } } function displayForm() { global $relativeScriptPath; $borderThickness = 3; global $formHeadColor; global $formBodyColor; global $formTailColor; global $formHeadText; global $formBodyText; global $langName; global $langEmail; global $langMessage; global $langSubmit; // Writing HTML Code ?> <center> <? $ip=$_SERVER['REMOTE_ADDR']; $block[0] = "86.101.13.1"; $block[1] = "202.137.118.6"; foreach ($block as $b) { if ($b == $ip) { $blocked = 1; } } ?> <? if ($blocked == "") { ?> <script language="JavaScript"> function check() { var a=String(document.vendegform.name.value).length; // sima input var b=String(document.vendegform.message.value).length; // sima input var c=String(document.vendegform.image.value).length; // sima input if (a==0){window.alert("Üres név mező!");return false;} // sima input if (b==0){window.alert("Üres mező!");return false;} // sima input if (c==0){window.alert("Kérek egy biztonsági kódot!");return false;} // sima input return true; } </script> <form method="POST" name="vendegform" action="<?php echo $relativeScriptPath; ?>"> <table width="660" align="center" border="1" cellspacing="0" cellpadding="0"> <tr> <td> Biztonsági kód: <br> <input type="text" name="image" class="input_text"><br /> <br> <img src="image.php" border="0"><br /> </td></tr> <tr> <td><font color=<?php echo $formHeadText; ?> size=2><b><?php echo $langName; ?></b></font> <input name="name" size="15" maxlength="50" class="input_text" style="margin-left: 19px; margin-bottom: 5px;"><br> <font color=<?php echo $formHeadText; ?> size=2><b><?php echo $langEmail; ?></b></font> <input name="email" size="15" maxlength="50" class="input_text"> </td> <td> <textarea name="message" cols="40" rows="3" style="width: 380px; height: 43px;" class="input_text" onKeyDown="textCounter(document.vendegform.message,document.vendegform.fpfszam,2000)" onKeyUp="textCounter(document.vendegform.message,document.vendegform.fpfszam,2000)"></textarea><input readonly type="text" name="fpfszam" maxlength="4" value="2000" style="border: 1px solid #C4BB9C; color: #000000; background-color: #eeeeee; width: 34px; margin-bottom: 10px; margin-left: 15px;"> </td> <td> <input type="button" value="Frissít" class="input_button" onclick="javascirpt:window.location.reload();" style="width: 50px; margin-bottom: 5px;"><br> <input type="submit" onClick="return check();" value="<?php echo $langSubmit; ?>" class="input_button" style="width: 50px;"> </td></tr> </table> </form> <?php } } //****************************************************************************** // function displayMessage displays the $errorMessage error message. function displayMessage($errorMessage,$msgType) { global $adminHeadColor; global $adminHeadText; global $adminBodyColor1; global $adminBodyText1; global $adminBodyColor2; global $adminBodyText2; global $langAdminError; global $langSystemError; global $langSystemMessage; global $langBsGuestbook; displayHeader(); if ($msgType=="1") $messageTitle = $langAdminError; // Admin Message if ($msgType=="2") $messageTitle = $langSystemError; // System Error if ($msgType=="3") $messageTitle = $langSystemMessage; // System Message ?> <table width="410" height="100%" align="center" border="0"><tr><td width="660" valign="middle" align="center"> <table cellspacing="0" border="0" width="250"><tr><td bgcolor=<?php echo $adminHeadColor;?>> <font Color=<?php echo $adminHeadText;?> size="-3">&nbsp; <?php echo $langBsGuestbook;?></font><br> </td></tr><tr><td bgcolor=<?php echo $adminBodyColor1;?>><font color=<?php echo $adminBodyText1;?>> <?php echo $messageTitle;?> </font> </td></tr><tr><td bgcolor=<?php echo $adminBodyColor2;?> align="center"> <font color=<?php echo $adminBodyText2;?>> <br><b><?php echo $errorMessage;?></b><br><br> </font></td></tr></table><p>&nbsp;</p> </td></tr></table> <?php displayFooter(); exit; } //****************************************************************************** // function standardizeText filters ambiguous chains in $str function standardizeStoredText($str) { $str = str_replace("\'", "'", $str); $str = str_replace("\"", """, $str); $str = htmlspecialchars($str); $str = str_replace("\n", "<br>", $str); $str = str_replace("$", "&#036;", $str); return $str; } function standardizeDisp
Mutasd a teljes hozzászólást!

Ez a téma lezárásra került a moderátor által. A lezárás oka: 1 t�ma - 1 k�rd�s
Tetszett amit olvastál? Szeretnél a jövőben is értesülni a hasonló érdekességekről?
abcd