View previous topic :: View next topic |
Author |
Message |
Lalaith
Joined: 24 Oct 2003 Posts: 10
|
Posted: Sun Dec 05, 2004 6:30 am Post subject: |
|
|
The one posted by evelyne, or the last one you posted? Sorry, I'm a little confused by all this, lol. |
|
Back to top |
|
 |
Cyberian75
Joined: 26 Sep 2002 Posts: 1267 Location: Oregon
|
Posted: Sun Dec 05, 2004 7:27 am Post subject: |
|
|
Use this...
Code: |
$word = strtolower(trim($HTTP_POST_VARS["word"]));
$postdata = get_postdata($comment_post_ID);
$content = strip_tags($postdata["Content"]);
eregi("[a-z0-9\-]+", $content, $matches);
if (empty($word) || $word != strtolower($matches[0])) {
setcookie("comment",$comment, time()+30000000);
echo "Error: the word you entered do not match or is empty.";
echo "\n<br><br>\n<a href=\"javascript:history.go(-1);\">go back</a>\n\n";
exit;
} elseif (isset($HTTP_COOKIE_VARS["comment"])) {
setcookie("comment","", time()-30000000);
}
|
_________________ Michael P.

Last edited by Cyberian75 on Sat Dec 11, 2004 1:03 am; edited 1 time in total |
|
Back to top |
|
 |
Sigg3
Joined: 03 Jul 2003 Posts: 779 Location: Oslo, Norway
|
|
Back to top |
|
 |
Lalaith
Joined: 24 Oct 2003 Posts: 10
|
Posted: Tue Dec 07, 2004 4:39 am Post subject: |
|
|
This part:
Code: |
$comment = (empty($HTTP_COOKIE_VARS["comment"])) ? "comment" : $HTTP_COOKIE_VARS["comment"];
|
I'm having trouble with. Where exactly do I put it in the comments page? Should I put it below this part:
Code: |
$comment_author_url = (empty($HTTP_COOKIE_VARS["comment_author"])) ? "url" : trim($HTTP_COOKIE_VARS["comment_author_url"]);
|
Or what? Or do I not need that?  |
|
Back to top |
|
 |
Cyberian75
Joined: 26 Sep 2002 Posts: 1267 Location: Oregon
|
Posted: Tue Dec 07, 2004 5:14 am Post subject: |
|
|
Lalaith wrote: | Should I put it below this part:
Code: |
$comment_author_url = (empty($HTTP_COOKIE_VARS["comment_author"])) ? "url" : trim($HTTP_COOKIE_VARS["comment_author_url"]);
|
|
Yes -- before or after it. _________________ Michael P.
 |
|
Back to top |
|
 |
Lalaith
Joined: 24 Oct 2003 Posts: 10
|
Posted: Fri Dec 10, 2004 12:50 am Post subject: |
|
|
I'm still having trouble with this! I've put the line of code below:
Code: |
$comment = (empty($HTTP_COOKIE_VARS["comment"])) ? "comment" : $HTTP_COOKIE_VARS["comment"];
|
Code: |
Please enter the <b>first word</b> of this post: <input type="text" name="word" size="10">
|
Code: |
<?php echo $comment ?>
|
On b2comments.php and on b2commentspopup.php, but the field still doesn't show up on the commenst form! Not only that, but next to the comments link in my blog it has the following coding:
Code: |
$comment = (empty($HTTP_COOKIE_VARS["comment"])) ? "comment" : $HTTP_COOKIE_VARS["comment"];
|
What am I doing wrong? The url to my blog is http://starlit-seas.net/blog Sorry for being such a nuisance. =\ |
|
Back to top |
|
 |
Cyberian75
Joined: 26 Sep 2002 Posts: 1267 Location: Oregon
|
Posted: Fri Dec 10, 2004 2:01 am Post subject: |
|
|
It appears to be fixed...? _________________ Michael P.
 |
|
Back to top |
|
 |
squidy
Joined: 10 Dec 2004 Posts: 3
|
Posted: Fri Dec 10, 2004 4:52 am Post subject: |
|
|
how do i change the first word of the post to the first word of the title?, i have the problem with the images. |
|
Back to top |
|
 |
Cyberian75
Joined: 26 Sep 2002 Posts: 1267 Location: Oregon
|
Posted: Fri Dec 10, 2004 5:22 am Post subject: |
|
|
squidy wrote: | how do i change the first word of the post to the first word of the title?, i have the problem with the images. |
Change... Code: | $content = $postdata["Content"]; | to Code: | $content = $postdata["Title"]; |
_________________ Michael P.
 |
|
Back to top |
|
 |
squidy
Joined: 10 Dec 2004 Posts: 3
|
Posted: Fri Dec 10, 2004 5:38 am Post subject: |
|
|
i have no words to express my happiness at this time, the spam is gone, i feel like crying, thanx to all who work in this, i love u all. |
|
Back to top |
|
 |
Lalaith
Joined: 24 Oct 2003 Posts: 10
|
Posted: Fri Dec 10, 2004 10:26 pm Post subject: |
|
|
Cyberian75 wrote: |
It appears to be fixed...? |
OK, it was just my computer. Thanks so much for all of your help. =D |
|
Back to top |
|
 |
Cyberian75
Joined: 26 Sep 2002 Posts: 1267 Location: Oregon
|
Posted: Sat Dec 11, 2004 1:05 am Post subject: |
|
|
Replace... Code: | $postdata["Content"]; | with Code: | strip_tags($postdata["Content"]); |
_________________ Michael P.
 |
|
Back to top |
|
 |
asiansoul
Joined: 29 Mar 2004 Posts: 4
|
Posted: Wed Dec 15, 2004 1:48 am Post subject: |
|
|
thanks. michael ur a genious! _________________ Ivy
http://mezza-9.net |
|
Back to top |
|
 |
Sigg3
Joined: 03 Jul 2003 Posts: 779 Location: Oslo, Norway
|
|
Back to top |
|
 |
Cyberian75
Joined: 26 Sep 2002 Posts: 1267 Location: Oregon
|
Posted: Wed Dec 15, 2004 7:02 pm Post subject: |
|
|
Yup!  _________________ Michael P.
 |
|
Back to top |
|
 |
|