Help with php code


Posted on 16th Feb 2014 07:03 pm by admin

Hello, can anyone tell me why this php word trap fails to work,
and the trigger words get blow right past, and the comments get posted anyway?
heres the php code im testing on a server.

<?php
$words = array(

'murmer',
'frog',
'bat',

);

$continue = true;

foreach ($words as $word) {

if (preg_match('/b' . $word . 'b/i', $post)) {
$continue = false;
exit();
}

}

if (!$continue) {
// Bad boy!
}

else {
// Post message
}
$fc = fopen("comments.txt","a+b"); //opens the file to append new comment -
fputs($fc,$_POST['comments']."nnnNewComment->"); //writes the comments followed by a
fclose($fc); //closes the files

if(sizeof($_POST)) {
$body = "";
while(list($key, $val) = each($HTTP_POST_VARS)) {
$body .= "$key: $val n";
}

mail("myemail@myemail.com", // to
"Subject Line",
$body);

header("Location: mysite.html");
}

// end form processing
?>

No comments posted yet

Your Answer:

Login to answer
152 Like 52 Dislike
Previous forums Next forums
Other forums

Adding to an Int row in db
Hi, i have a database which houses all of the users of my site. One of the columns is for points whi

Help on Order Entry Form/System Where is best to begin.
I have a dilema and a very short amount of time at this point and I'm looking for some help on decid

Image resize
Hi again fellers

I managed to sort out the issues with the folder,

Final hurdle is th

Credit card verification
I have a client who wants to process credit card transactions from his web site rather than the goin

What do you call the "token" thing?
You know how some sites have links that run on tokens? Tokens are links that only stay alive for a c

storing results of a function - previous result overwritten with new result
I have created a function to validate input.

function validate_dimension($value,$name) {
<

Timer control causing error
I recently decided to add a timer control to an existing page that uses AJAX on my site. As soon as

What am I missing here? Help!
Hello all!. I can't seem to get this working right. Well - it renders right, but something is goin

Embedding flash object in Else statement
This is my first major project in PHP and I'm having some trouble embedding a flash object in an Els

Warning message
I've put a website that I was doing live and I'm getting this warning message when I try to add a ne

Sign up to write
Sign up now if you have flare of writing..
Login   |   Register
Follow Us
Indyaspeak @ Facebook Indyaspeak @ Twitter Indyaspeak @ Pinterest RSS



Play Free Quiz and Win Cash