Jump to content

mcfly

New Members
  • Posts

    3
  • Joined

  • Last visited

    Never

Profile Information

  • Gender
    Not Telling

mcfly's Achievements

Newbie

Newbie (1/5)

0

Reputation

  1. Thanks a lot! It works perfectly! Erik
  2. OK, thanks, folks! But I can't get it to work.. Excactly where shall I write it? Could anyone just edit the code for me and post it here? (I'm not a web-dude at all, I was just left alone trying to fix my own page) Thanks! Erik [code]<?php while(list($key, $val) = each($HTTP_POST_VARS)) { $val = str_replace("<", "&lt;", $val); $HTTP_POST_VARS[$key] = str_replace(">", "&gt;", $val); } $date = date("d. m. Y H:i:s"); $logit = "<font style=\"font-family: arial; font-size: 8pt;\"><p><b>Name:</b> ".$HTTP_POST_VARS["navn"]."<br>". "<b>Time:</b> $date<br>". "<b>Comment: </b>".$HTTP_POST_VARS["kommentar"]." <br><hr> \n"; $logit = stripslashes($logit); $fp = fopen ("innlegg.txt", "r+") or die("Error, something is wrong."); $Old = fRead ($fp, filesize("innlegg.txt")); fclose ($fp); $fp = fopen ("innlegg.txt", "w") or die("Error, something is wrong."); fwrite ($fp, $logit); fwrite ($fp, $Old); fclose ($fp); header("Location: crapbook.php"); ?>[/code]
  3. Hi, see below.. This is a php file that writes guestbook info to a txt file. I have a problem with spam in my guestbook, and I wonder if anyone knows about a "tag" that can block web addresses entered in the "comment field" F.ex. If you enter "http://www" in the comment field, you will get blocked... Just take a look at this site, and you'll know what i mean; http://slap-madcap.com/guestbook.php Thanks --- Erik <?php while(list($key, $val) = each($HTTP_POST_VARS)) { $val = str_replace("<", "&lt;", $val); $HTTP_POST_VARS[$key] = str_replace(">", "&gt;", $val); } $date = date("d. m. Y H:i:s"); $logit = "<font style=\"font-family: arial; font-size: 8pt;\"><p><b>Name:</b> ".$HTTP_POST_VARS["name"]."<br>". "<b>Time:</b> $date<br>". "<b>Comment: </b>".$HTTP_POST_VARS["comment"]." <br><hr> \n"; $logit = stripslashes($logit); $fp = fopen ("innlegg.txt", "r+") or die("Error, somthing is wrong."); $Old = fRead ($fp, filesize("innlegg.txt")); fclose ($fp); $fp = fopen ("innlegg.txt", "w") or die("Error, somthing is wrong."); fwrite ($fp, $logit); fwrite ($fp, $Old); fclose ($fp); header("Location: guestbook.php"); ?> [b]edit(shoz): Edited for language[/b]
×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.