/    Sign up×
Community /Pin to ProfileBookmark

Two Codes, one messes everything up, the other works fine

It’s not that simple. The newer code offers functionality that I need. Anyway, here is the offending section of code.

[code=php] if ($filterdeclare == 1 AND $filterbypass == 0){
$resultfilter = false;
$filterdeclare = 0;
$afiltertext = ”;
if ($exfilter == true AND $mcfilter == true) {
if ($filterstring <> $filtertext){ //3
$arrayback[$zeilen] = ”;
$zeilen = $zeilen-1;
$filterbypass = 1;
}
}
else {
if ($exfilter == false){
if(strpos($filterstring, $filtertext) === false)
{$resultfilter = true;}
}
if ($mcfilter == false){
$filterstring = mb_convert_case($filterstring, MB_CASE_LOWER, “UTF-8”);
$afiltertext = mb_convert_case($filtertext, MB_CASE_LOWER, “UTF-8″);
if($afiltertext <> $filterstring)
{$resultfilter = true;}
if ($exfilter == false){
if(strpos($filterstring, $afiltertext)===false)
{$resultfilter = true;}
}
}
if ($resultfilter == true){
$arrayback[$zeilen] = ”;
$zeilen = $zeilen-1;
$filterbypass = 1;
}
}
}[/code]

The code section that works replaces this section with something much smaller, but with less functionality.

[code=php]
if ($filterdeclare == 1 AND $filterbypass==0){
if ($filterstring <> $filtertext){
$arrayback[$zeilen] = ”;
$zeilen = $zeilen-1;
$filterbypass = 1;
}
$filterdeclare = 0;
}
[/code]

When the variables $mcfilter and $exfilter are set at true, the two codes should not be different from each other. But this is not the case. In addition, when the code is NOT being run, it still messes up the layout. I’ve pored over it several times, and I still can’t find any error. If anyone needs more information, like the entire page, I’d be happy to provide it, but I’m pretty sure the problem is here. I there anything fundamentally wrong with the first segment of code? And do the two segments of code act the same if $mcfilter and $exfilter are set to true?

to post a comment
PHP

0Be the first to comment 😎

×

Success!

Help @Eupseudes 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.18,
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,
)...