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
?>
Renaming a file that a user uploads to site?
My site allows for registered users to upload images to the site under their own gallery. Currently it just leaves the file named as however the person has it named. But what I would like to do is
problem with php mysql query
Hi guy's...I'm totally lost here..because don't have any idea how to make a query for grab record using BETWEEN startdate and enddate since existing record are stored using this format
trim function issues
Hi guys, total noob here... So I've been tinkering around with a html and am using php to email the subitted data to me. It's all working fine, except now I've changed the rules of the form a little
issues verifying if user is logged in
I am having issues when a user logs in via asp Login control, the IsAuthenticated still seems to come up false... ( yes the username and password is correct)
Check premium expire
Hi,I am making a simple file hosting site and want to check if users premium subscriptions have ended or not. In the database i have premium_start ( time() ) and premium_end ( time() ) that represents
Refining of search Criteria
Dear FriendsI need a help, I have a search page which of cars related, which has different search criteria e.g. maker, model, color, displacement etc. when i give any search criteria and click the
restricting another login once you logout
Hello,how can I restrict a page from login authenticating against info in a MySQL DB for a second time? Right now a login check against username and password in a MySQL table and allows access against
Odd or Even
Inside of a while loop I need to echo several rows of info...easy enough.In the loop (for the sake off css) I need to distinguish between odd and even row numbers.Code:
Select question
Hi,First I would like to say that php is pretty new for me.. so please don't shoot me if this should be a stupid question!But I'm a little surpized due to following..I have a search script (very large
Creating a db with a query
Hello everyone.I'm having troubles creating a db with a query.I'm reading a book called PHP Bibles from Tim Converse I get this errorFatal error: Call to undefined function mysql_create_db() in