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

Disable html within defined tags
I have a mysql database that allows users to enter content with html, but I also want to have a tag

asp authentication problem
Hello all, I want to use the asp authentication (from asp.net configuration) in my web site. there

help with image text
Hi ...

see i need the text of the name and number to start in the center and always be in the

simple script won't work. Please help
I'm new to php, and I am having trouble displaying a simple script in my web browser. My php code ex

Strange array issue, never happened before.
mysql_fetch_array returns 1 array per call. Generally that's why it is inserted into a while statem

Ten Operator Syntax
Hi Guys,

I can't figure out why i am getting a parse error with this basic ten op code:

Hotlinking Picasa as the image folder of a website
Hi there PHP freaks, I would like to create a private album in Picasa to use it as the image folder

Creating a custom API
I'm creating a site, and I need to create a basic API. Unfortunately I have no idea where to start.

pop3 and fsockopen
So I am able to connect to the pop3 server, log in, and check how many messages there are. I am hav

max function question
Hi All
Ihave a table that holds shipment numbers and dates like this

select * from

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