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

Matchcode in ALV change header column
Hello everyone,

I am working in an SAP system that is currently in upgrade and conversion

in php, link returns to the line
When I add a link in a php page, the link word returns to the line (as a
would do)

Examp

Spaghetti Code
So.

I've pretty much reached the point where I have so many isset s on one page that I can't

InternetOpenUrl() Invalid cert
Hi all,

Does anyone know how to prevent calls to InternetOpenUrl() from failing with erro

Parse error: syntax error, unexpected T_ELSEIF in /home/......html/item.php on l
I do not know what is wrong with this. Hope some one can help. I do nto want to post the entire site

gettext translates ALWAYS?
I'm using gettext with the new version of XAMPP (5.3.0) on Windows Seven RTM (build 7600)
gettext

get multiple rows
Hi I want to get multiple rows from a db

I am using this for the db query
Code: public

Trouble with a select list
Hello All!
I was wondering if any of you guys could help me with a small problem I'm having!

Option box to change variable
Hello, i need help by making a script!

I need to write a file with option box, so a dropdown

ldap connection
We are using ldap to get user information from the domain controller. It was working before. Recentl

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