View previous topic :: View next topic |
Author |
Message |
datwig -
Joined: 26 Jan 2003 Posts: 85
|
Posted: Mon Apr 21, 2003 8:10 pm Post subject: fUncTiOnS |
|
|
I setup this function but I can't get it to work.
Code: |
function fmagic( $n ) {
$n = htmlspecialchars($n);
$n = nl2br($n);
}
$entry = fmagic( $entry );
$subject = fmagic( $subject );
$item = fmagic( $item );
echo $entry;
echo $subject;
echo $item;
|
all it returns is blank
Can someone help me?
I am using PHP version 4.3.1 |
|
Back to top |
|
|
TheLinker -
Joined: 05 Apr 2002 Posts: 165 Location: Oslo, Norway
|
Posted: Tue Apr 22, 2003 7:31 am Post subject: |
|
|
Try this:
Code: | function fmagic( $n )
{
$n = htmlspecialchars($n);
$n = nl2br($n);
return $n;
}
| 8) |
|
Back to top |
|
|
datwig -
Joined: 26 Jan 2003 Posts: 85
|
Posted: Tue Apr 22, 2003 5:56 pm Post subject: |
|
|
TheLinker wrote: | Try this:
Code: | function fmagic( $n )
{
$n = htmlspecialchars($n);
$n = nl2br($n);
return $n;
}
| 8) |
There's a problem. the variable $n is nulled. I never used it except for in the function. |
|
Back to top |
|
|
TheLinker -
Joined: 05 Apr 2002 Posts: 165 Location: Oslo, Norway
|
Posted: Tue Apr 22, 2003 7:07 pm Post subject: |
|
|
Try to print out the $n variable in the function to see where it gets nulled. |
|
Back to top |
|
|
|