You are here: Basic question about incuding files and funcitons « PHP Programming Language « IT news, forums, messages
Basic question about incuding files and funcitons

Posted by Jimmy Clay on 11/16/80 11:28

I have a very basic question about how to include files to be used by
another file. I'm trying to include a bad word filter into the guestmap on
my website. I know almost nothing about PHP code. I've tried everything I
can think of but I keep getting error messages. The bad word filter code I
found else where is this:


File name is badwords.php

<?php
//* Check.php */

function check( ) /* Establishes the function check */
{

global $message; /* Gets All Variables */

//To Add New Words, Just Copy One Line From Below And Paste It Below The
Third Line.
//Just Replace the first word in quotes with the word you would like,
//and the second word in quotes to what you would like to change it to.//

$message = str_replace("bad word1","**",$message); /* Replaces the word
"hey" into "****" */
$message = str_replace("bad word2","**",$message);
$message = str_replace("bad word 3","**",$message);

echo $message;

}

return check(); //* Returns the function check() */

?>

I would like to keep this as a separate file and include it into the main
file. In the main file I inserted the two code lines:

include('badwords.php')
check('$message')

I've tried a lot of different things to get this to work but I always get
error messages when I run it on my website. I would like to keep it in a
separate file from the main file because of all the bad words. Also I need a
function because I would like to have it check the variables for several
fields.

So what should I do to get this to work?

--

Jimmy Clay

Read free ebooks !!!!!
Go to my web page:
www.songofthecoyote.com/

 

Navigation:

[Reply to this message]


Удаленная работа для программистов  •  Как заработать на Google AdSense  •  England, UK  •  статьи на английском  •  PHP MySQL CMS Apache Oscommerce  •  Online Business Knowledge Base  •  DVD MP3 AVI MP4 players codecs conversion help
Home  •  Search  •  Site Map  •  Set as Homepage  •  Add to Favourites

Copyright © 2005-2006 Powered by Custom PHP Programming

Сайт изготовлен в Студии Валентина Петручека
изготовление и поддержка веб-сайтов, разработка программного обеспечения, поисковая оптимизация