Advertisement
Syntafin

blog.php Kommentarprüfung

Mar 22nd, 2012
35
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
PHP 1.83 KB | None | 0 0
  1. <?php
  2.     }
  3.     }
  4.     if(isset($_GET['action']) AND 'commentpost' == $_GET['action']) {
  5.     require_once('core/include/recaptchalib.php');
  6.   $privatekey = "6Lfpvs4SAAAAAGH7bNbO-ItVzjlWbuouO-JfuGGk";
  7.   $resp = recaptcha_check_answer ($privatekey,
  8.                                 $_SERVER["REMOTE_ADDR"],
  9.                                 $_POST["recaptcha_challenge_field"],
  10.                                 $_POST["recaptcha_response_field"]);
  11.  
  12.   if (!$resp->is_valid) {
  13.     // What happens when the CAPTCHA was entered incorrectly
  14.     die ("The reCAPTCHA wasn't entered correctly. Go back and try it again." .
  15.          "(reCAPTCHA said: " . $resp->error . ")");
  16.   } else {
  17.     $sqlk = "INSERT INTO blog_kommentare
  18.                    (
  19.                        blog_id,
  20.                        display,
  21.                        datum,
  22.                        name,
  23.                        email,
  24.                        homepage,
  25.                        naricht
  26.                    )
  27.        VALUES
  28.                    (
  29.                        ".intval($_GET['id']).",
  30.                        'yes',
  31.                        NOW(),
  32.                        '".mysql_real_escape_string($_POST['form-name'])."',
  33.                        '".mysql_real_escape_string($_POST['form-email'])."',
  34.                        '".mysql_real_escape_string($_POST['form-url'])."',
  35.                        '".mysql_real_escape_string($_POST['form-comment'])."'
  36.                    )";
  37.     $qry = mysql_query($sqlk,$datenbank) or die(mysql_error());
  38.     }
  39. }
  40.     if(isset($_GET['action']) AND 'commentcheck' == $_GET['action']) {
  41.         echo('<p>'.$_POST['blog_id'].'</p>'."\n");
  42.         echo('<p>'.$_POST['form-name'].'</p>'."\n");
  43.         echo('<p>'.$_POST['form-email'].'</p>'."\n");
  44.         echo('<p>'.$_POST['form-url'].'</p>'."\n");
  45.         echo('<p>'.$_POST['form-comment'].'</p>'."\n");
  46.     }
  47. ?>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement