
mam problem z skryptem który można pobrać z http://www.phpcaptcha.org
Jest tam instrukcja (http://www.phpcaptcha.org/?page_id=8) jak ten skrypt połączyć ze swoją stroną. Używam CutePHP i jest to dla mnie za skomplikowane aby samodzielnie zrobić. Oczywiście z formularzem sobie poradziłem ale mam problem z drugą częścią, która sprawdza przepisane znaki. Bądźcie wyrozumiali - jestem "przedszkolakiem". Będę wdzięczny za pomoc.
Oto część kodu CutePHP gdzie odbywa się zapisywanie komentarza (plik inc/shows.inc.php):
<?PHP include_once("$cutepath/langdate.php"); do{ // Used if we want to display some error to the user and halt the rest of the script $user_query = cute_query_string($QUERY_STRING, array( "comm_start_from","start_from", "archive", "subaction", "id", "ucat")); $user_post_query = cute_query_string($QUERY_STRING, array( "comm_start_from", "start_from", "archive", "subaction", "id", "ucat"), "post"); //############################## // Add Comment //############################## if($allow_add_comment){ $id = (int) $id; // Yes it's stupid how I didn't thought about this :/ //---------------------------------- // Check the lenght of comment, include name + mail //---------------------------------- $CN_HALT = TRUE; break 1; } $CN_HALT = TRUE; break 1; } if( strlen($comments) > $config_comment_max_long and $config_comment_max_long != "" and $config_comment_max_long != "0"){ $CN_HALT = TRUE; break 1; } //---------------------------------- // Add The Comment ... Go Go GO! //---------------------------------- $found = FALSE; foreach($old_comments as $old_comments_line) { if($old_comments_arr[0] == $id) { fwrite($new_comments, "$old_comments_arr[0]|>|$old_comments_arr[1]$time|$name|$mail|$ip|$comments||\n"); $found = TRUE; }else{ //if we do not have the news ID in the comments.txt we are not doing anything (see comment below) (must make sure the news ID is valid) } } if(!$found){ /* // do not add comment if News ID is not found \\ fwrite($new_comments, "$id|>|$time|$name|$mail|$ip|$comments||\n");*/ echo("<div style=\"text-align: center;\">CuteNews nie dodał twojego komentarza, gdyż wyst?pił problem z baz? danych.<br /><a href=\"java script:history.go(-1)\">powrót</a></div>"); $CN_HALT = TRUE; break 1; } //---------------------------------- // Sign this comment in the Flood Protection //---------------------------------- if($config_flood_time != "0" and $config_flood_time != "" ){ } //---------------------------------- // Notify for New Comment ? //---------------------------------- if($config_notify_comment == "yes" and $config_notify_status == "active"){ send_mail("$config_notify_email", "CuteNews - Dodano Nowy Komentarz", "Został dodany nowy komentarz przez $name:\n--------------------------$comments"); } echo "<script type=\"text/javascript\">window.location=\"$PHP_SELF?subaction=showfull&id=$id&ucat=$ucat&archive=$archive&start_from=$start_from&$user_query\";</script>"; }
Dzięki!