Variable transformations using included function
Posted: Wed May 14, 2003 12:01 pm
Hidee-ho, ya'll! Here's what I'm doing...what am I doing wrong??? I've got this function in an include file:
And I've got this form/code on a separate page to call the function and make the appropriate transformations:
I get nothing for the transformed variable. If it's something obvious forgive me ahead of time...chide me if you must! 
Code: Select all
//prepare variables from text fields for DB entry
function text_prep($text) {
$text = strip_tags($text);
$text = htmlentities($text);
$text = addslashes($text);
$text = nl2br($text);
}Code: Select all
<form action="test.php" name="new_user" method="post">
Text: <input type="text" name="practice" size="30" maxlength="100">
<input type="submit" name="submit" value="Submit">
</form><br>
<?php if(isset($_POSTї'practice'])) echo "Transformed: " . text_prep($_POSTї'practice']) . "<br>Original: " . $_POSTї'practice']; ?>