View Full Version : Need help (2 Questions)


Phillip
04-06-2007, 08:16 PM
Hello firstly, I have forgotten how to make a form filter out html tags for example:

If I typed <p>Hello my name is <b>Phillip</b></p> in a form it would come out as bold... but how do I make it come out like tags?

Second does anyone know anything about Lingo? If so, can you use mysql databases with it?

Idiotic Creation
04-07-2007, 09:58 PM
For your first question, you can use PHP's string functions. I don't remember them because its been a while since I've used them, but thats what php.net is for.

Basically something like this:
1. Use search function to search the inputed string for "<" or ">". (Function should return an irrator to the position of the character)
2. Use replace function to replace the "<" or ">" with &lt; or &gt;

Or you could completely remove the tags with a functions like this:

//Declaration:
function cleanup ($data)
{
return trim (htmlentities(strip_tags($data)));
}

//Then use it like this:
$username = cleanup ($_POST["username"]);


I don't know anything about Lingo, sorry.

Good Luck,
David