fUncTiOnS

 
Post new topic   Reply to topic    Aprelium Forum Index -> PHP
View previous topic :: View next topic  
Author Message
datwig
-


Joined: 26 Jan 2003
Posts: 85

PostPosted: Mon Apr 21, 2003 8:10 pm    Post subject: fUncTiOnS Reply with quote

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 View user's profile Send private message AIM Address
TheLinker
-


Joined: 05 Apr 2002
Posts: 165
Location: Oslo, Norway

PostPosted: Tue Apr 22, 2003 7:31 am    Post subject: Reply with quote

Try this:
Code:
function fmagic( $n )
{
    $n = htmlspecialchars($n);
    $n = nl2br($n);
    return $n;
}
8)
Back to top View user's profile Send private message Visit poster's website
datwig
-


Joined: 26 Jan 2003
Posts: 85

PostPosted: Tue Apr 22, 2003 5:56 pm    Post subject: Reply with quote

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 View user's profile Send private message AIM Address
TheLinker
-


Joined: 05 Apr 2002
Posts: 165
Location: Oslo, Norway

PostPosted: Tue Apr 22, 2003 7:07 pm    Post subject: Reply with quote

Try to print out the $n variable in the function to see where it gets nulled.
Back to top View user's profile Send private message Visit poster's website
Display posts from previous:   
Post new topic   Reply to topic    Aprelium Forum Index -> PHP All times are GMT + 1 Hour
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum


Powered by phpBB phpBB Group