Script Einbau->ich checks nicht.

Hier werden Probleme rund um das Zahlen Captcha behandelt

Moderator: frameguard

Script Einbau->ich checks nicht.

Beitragvon kleenerjanko » 22.01.2008, 21:10

Hallo Leute. habe jetzt schon mehrere Stunden damit verbracht, den Code ins script einzubauen und hier das Forum studiert. Habe auch x varianten ausprobiert, das mehrere das selbe Problem hatten, aber alles ohne erfolg, da doch die scripte anders geschrieben sind. In das Formular funktioniert einwandfrei, aber mit dem script habe ich arge Probleme.
Entweder das Bekomm ich fehlermeldungen oder Es funktioniert, aber die überprüfung findet nicht statt. Also egal ob ich richtig falsch oder gar nix reinschreibe, es funzt nicht.
Anderswiederrum, scheint es zu funktionieren, aber wenn ich dann auf "ins GB eintragen" klicke kommt sofort die meldung das der Sicherheitscode falsch ist.
Ich wäre echt sehr dankbar wenn mir jemand den kleinen codeschnipsel so einfügt das es auch funktioniert. Hier mein ursprüngliches Script:

Code: Alles auswählen
<?php
class Module {
   function Module() {
   global $gcgb, $DB, $skin;

      // I'm borrrred, what shall I do?
      // I know...

      switch ($gcgb->input['c']) {
         case 'sign':
            $this->Form();
         break;
         case 'process':
            $this->Process();
         break;
         default:
            $this->Form();
      }

   }

   function Form() {
      global $gcgb, $DB, $skin;

      // Include the Post Form JavaScript + Start Form
      echo '<script type="text/javascript" src="script/gccode.js"></script><form name="postform" action="'.$gcgb->baseurl.'" method="post"><input type="hidden" name="a" value="sign" /><input type="hidden" name="c" value="process" />';

      // Can we use GCCode? If so, insert buttons.
      if ($gcgb->config['allow_gccode']) {
         $buttons = '<input type="button" name="buttonb" value="Fett" style="font-weight: bold;" onClick="bold()" />&nbsp;<input type="button" name="buttoni" value="Kursiv" style="font-style: italic;" onClick="italic()" />&nbsp;<input type="button" name="buttonu" value="Unterstrichen" style="text-decoration: underline;" onClick="underline()" />&nbsp;<input type="button" name="buttonurl" value="http://" style="color: blue; text-decoration: underline;" onClick="url()" />';
      }
      else {
         $buttons = "Disabled";
      }

      // Get Emotions
      $DB->query ("SELECT find, rep FROM gcgb_filters WHERE is_emo='1'");$emoticons = "";
      while ($row = $DB->fetch_array()) {
         $emoticons .= '<img src="'.$gcgb->config['smileyfolder'].'/'.$row['rep'].'" alt="'.$row['find'].'" onClick="javascript:addemo(\''.$row['find'].'\')" style="cursor: hand;" />';
      }

      $skin->LoadSkin("postform");
      echo $skin->ParseSkin("postform", array("codebuttons" => $buttons, "emoticons" => $emoticons));
   }

   function Process() {
      global $gcgb, $DB, $skin;

      // Do we have a comment?
      if (!$gcgb->input['comments'] OR $gcgb->input['comments'] == "") {
         $skin->LoadSkin("notice");
         echo $skin->ParseSkin("notice", array("message" => "You did not enter the comments box."));
      }
      else if (!$gcgb->input['name'] OR $gcgb->input['name'] == "") {
               $skin->LoadSkin("notice");
               echo $skin->ParseSkin("notice", array("message" => "You must enter your name."));
      }      
      else if (!$gcgb->input['email'] OR $gcgb->input['email'] == "") {
         $skin->LoadSkin("notice");
         echo $skin->ParseSkin("notice", array("message" => "You must enter your e-mail address."));
      }      
      else if (!eregi("^[_a-z0-9-]+(\.[_a-z0-9-]+)*@([0-9a-z](-?[0-9a-z])*\.)+[a-z]{2}([zmuvtg]|fo|me)?$",$gcgb->input['email'])) {
         $skin->LoadSkin("notice");
         echo $skin->ParseSkin("notice", array("message" => "You must enter a valid e-mail address."));
     }
      else {
         // Parse GCCode and HTML if applicable :)
         $comments = $gcgb->input['comments'];

         if ($gcgb->config['allow_html']) {
            // Parse &gt; and &lt; back into < and > because our clever input system
            // changed them into HTML equivilents
            $comments = str_replace ("&lt;", "<", $comments);
            $comments = str_replace ("&gt;", ">", $comments);
            $comments = str_replace ("&quot;", "\"", $comments);      
         }   
         if ($gcgb->config['allow_gccode']) {
            // Parse our GCCode into HTML equivilents
            $comments = preg_replace ("'\[b\]'si", "<strong>", $comments);
            $comments = preg_replace ("'\[/b\]'si", "</strong>", $comments);
            $comments = preg_replace ("'\[i\]'si", "<em>", $comments);
            $comments = preg_replace ("'\[/i\]'si", "</em>", $comments);
            $comments = preg_replace ("'\[u\]'si", '<span style="text-decoration: underline">', $comments);
            $comments = preg_replace ("'\[/u\]'si", "</span>", $comments);
            $comments = preg_replace ("'\[url=(.+?)]'si", "<a href=\"$1\">", $comments);
            $comments = preg_replace ("'\[/url\]'si", "</a>", $comments);
         }

         // Parse Emotions (if enabled for entry) and Bad Works - Tsk.
         if ($gcgb->input['disableemoticons']) {
            $wherefilter = " WHERE is_emo='0'";
         }
         else {
            $wherefilter = "";
         }
         $DB->query ("SELECT find, rep, is_emo FROM gcgb_filters".$wherefilter);

         while ($row = $DB->fetch_array()) {
            if ($row['is_emo']) {
               $comments = str_replace ($row['find'], "<img src=\"".$gcgb->config['smileyfolder']."/".$row['rep']."\" />", $comments);
            }
            else {
               $comments = preg_replace ("'{$row['find']}'si", $row['rep'], $comments);
            }
         }
         
         // Save it to the database. Why? Because we want to.
         // Actually, we have to but shhh.

         // Prepare the Query
         $hideemail = $gcgb->input['hideemail'] ? "1" : "0";
         $private = $gcgb->input['hidden'] ? "1" : "0";
         $queued = $gcgb->config['moderate'] ? "1" : "0";
         $time = time();
         $ip = $_SERVER['REMOTE_ADDR'];

         $DB->query("INSERT INTO gcgb_entries VALUES ('', '".$comments."', '".$gcgb->input['name']."', '".$gcgb->input['email']."', '".$hideemail."', '".$private."', '".$queued."', '".$time."', '".$ip."', '');");

         // Prepare Query and Update Statistics Table
         if ($queued) {
            $statsset = "queued = queued+1";
         }
         else {
            $statsset = "approved = approved+1";
         }
         $DB->query("UPDATE gcgb_stats SET entries = entries+1, ".$statsset);

         echo "Thanks for your comments. If the administrator hasn't chosen to premoderate all comments, your comment should appear on the View Guestbook page straight away.<br /><br />";
         
         $skin->LoadSkin("entry");
         echo $skin->ParseSkin("entry", array("id" => "", "name" => $gcgb->input['name'], "comments" => $comments, "reply" => "", "time" => date($gcgb->config['timeformat'], $time), "ip" => $ip, "email_link" => "mailto:".$gcgb->input['email']));
      }
   }
   
}
?>
kleenerjanko
 
Beiträge: 2
Registriert: 22.01.2008, 21:01

Zurück zu Zahlen Captcha

Wer ist online?

Mitglieder in diesem Forum: 0 Mitglieder und 0 Gäste

cron