/    Sign up×
Community /Pin to ProfileBookmark

php functions help

i have a file which is included in my header, and my header is included in my viewthread page ?

the function page has…

function ubbc($row){
$row = str_replace(“<“, “&lt;”, $row);
$row = str_replace(“>”, “&gt;”, $row);
}

in it, i tried to use on the view thread page…..

ubbc($row);

is that right the $row is from a mysql query ?

to post a comment
PHP

1 Comments(s)

Copy linkTweet thisAlerts:
@YoNFeb 11.2004 — If the $row is not in the golbal scope, it won't work...

I'd do the function return a result so you can grab it...[code=php]function ubbc($row){
$row = str_replace("<", "&lt;", $row);
$row = str_replace(">", "&gt;", $row);
return $row;
}

//Later in the script you can try...

$row = ubbc($row);[/code]
[i]Originally posted by lukezweb [/i]

is that right the $row is from a mysql query ? [/QUOTE]

If that $row comes from mysql, I guess ([I]Until I see your code so I can make sure[/I]) you should use $row['fieldname'] = ubbc($row['fieldname']); instead.
×

Success!

Help @lukezweb spread the word by sharing this article on Twitter...

Tweet This
Sign in
Forgot password?
Sign in with TwitchSign in with GithubCreate Account
about: ({
version: 0.1.9 BETA 5.19,
whats_new: community page,
up_next: more Davinci•003 tasks,
coming_soon: events calendar,
social: @webDeveloperHQ
});

legal: ({
terms: of use,
privacy: policy
});
changelog: (
version: 0.1.9,
notes: added community page

version: 0.1.8,
notes: added Davinci•003

version: 0.1.7,
notes: upvote answers to bounties

version: 0.1.6,
notes: article editor refresh
)...
recent_tips: (
tipper: @AriseFacilitySolutions09,
tipped: article
amount: 1000 SATS,

tipper: @Yussuf4331,
tipped: article
amount: 1000 SATS,

tipper: @darkwebsites540,
tipped: article
amount: 10 SATS,
)...