Woordfilter [PHP]

Gestart doorMarvinn14 reacties36 weergaven

15 berichten · pagina 1 van 1

Marvinn

Lid · Topicstarter

Berichten
2.609
Reputatie
0
Punten
0,00
Lid sinds
Laatst gezien
Hoi.

Een medewerker van mijn website heeft zn naam veranderd alleen zelf vergeet ik die naam steeds en typ ik zijn oude naam.

Nu wil ik een soort van woord filter over de website algemeen nu heb ik dit:

[COLOR= #0000BB]<?php[/COLOR]
[COLOR= #FF8000]//// Woordfilter ////[/COLOR]
    

[COLOR= #007700]function[/COLOR] handler[COLOR= #007700]([/COLOR][COLOR= #0000BB]$str[/COLOR][COLOR= #007700]){[/COLOR]
[COLOR= #0000BB]$naam[/COLOR] [COLOR= #007700]=[/COLOR] [COLOR= #DD0000]L-rider[/COLOR][COLOR= #007700];[/COLOR]
[COLOR= #0000BB]$str[/COLOR] [COLOR= #007700]=[/COLOR] [URL="http://www.php.net/str_replace"]str_replace[/URL][COLOR= #007700]([/COLOR][COLOR= #DD0000]K-rider[/COLOR][COLOR= #007700],[/COLOR] [COLOR= #0000BB]$naam[/COLOR][COLOR= #007700],[/COLOR] [COLOR= #0000BB]$str[/COLOR][COLOR= #007700]);[/COLOR]
[URL="http://www.php.net/return"]return[/URL] [COLOR= #0000BB]$str[/COLOR][COLOR= #007700];
}[/COLOR]
[URL="http://www.php.net/ob_start"]ob_start[/URL][COLOR= #007700]([/COLOR][COLOR= #DD0000]handler[/COLOR][COLOR= #007700]);[/COLOR]


[URL="http://www.php.net/ob_end_flush"]ob_end_flush[/URL][COLOR= #007700]();[/COLOR]


[COLOR= #FF8000]//// End ////[/COLOR]
?>


Alleen als ik K-rider typ dan blijft het K-rider, het moet L-rider worden. Ik heb dit gewoon in de class van de website zelf staan. Ik wil namelijk geen ubb troep.

Waarom werkt het niet sadley?
0
Berichten
35.796
Reputatie
1
Punten
0,00
Lid sinds
Laatst gezien
Dit is dan wel weer een hééééle omslachtige manier zeg. emo
0
Marvinn

Lid · Topicstarter

Berichten
2.609
Reputatie
0
Punten
0,00
Lid sinds
Laatst gezien
Oke oke het werkt alleen als ik 2x

$naam = ******;
$str = str_replace(SCHELDWOORD, $naam, $str);
return $str;
}
ob_start(handler); ?>
$naam = ******;
$str = str_replace(SCHELDWOORD, $naam, $str);
return $str;
}
ob_start(handler); ?>

Zo doe dan werkt het niet:

Fatal error: Cannot redeclare handler() (previously declared in /home/marvinr51/domains/habbotjes.be/public_html/class/woordfilter.php:1) in /home/marvinr51/domains/habbotjes.be/public_html/class/woordfilter.php on line 12
0
Marvinn

Lid · Topicstarter

Berichten
2.609
Reputatie
0
Punten
0,00
Lid sinds
Laatst gezien
Is er niks simpelers?

Als ik zeg hoi, word het doei ofzo?

Die link is allemaal zo ingewikkeld. Waarom niet gewoon simpel?
0
Berichten
35.796
Reputatie
1
Punten
0,00
Lid sinds
Laatst gezien
[COLOR= #0000BB]<?php
$zin[/COLOR] [COLOR= #007700]=[/COLOR] [COLOR= #DD0000]hoi ik ben lennard[/COLOR][COLOR= #007700];[/COLOR]
[URL="http://www.php.net/echo"]echo[/URL] [URL="http://www.php.net/str_replace"]str_replace[/URL][COLOR= #007700]([/COLOR][COLOR= #DD0000]hoi[/COLOR][COLOR= #007700],[/COLOR] [COLOR= #DD0000]doei[/COLOR][COLOR= #007700],[/COLOR] [COLOR= #0000BB]$zin[/COLOR][COLOR= #007700]);[/COLOR]
?>


Veel simpeler kan het niet.
0
Marvinn

Lid · Topicstarter

Berichten
2.609
Reputatie
0
Punten
0,00
Lid sinds
Laatst gezien
Lennard schreef:
[COLOR= #0000BB]<?php
$zin[/COLOR] [COLOR= #007700]=[/COLOR] [COLOR= #DD0000]hoi ik ben lennard[/COLOR][COLOR= #007700];[/COLOR]
[URL="http://www.php.net/echo"]echo[/URL] [URL="http://www.php.net/str_replace"]str_replace[/URL][COLOR= #007700]([/COLOR][COLOR= #DD0000]hoi[/COLOR][COLOR= #007700],[/COLOR] [COLOR= #DD0000]doei[/COLOR][COLOR= #007700],[/COLOR] [COLOR= #0000BB]$zin[/COLOR][COLOR= #007700]);[/COLOR]
?>
Veel simpeler kan het niet.

Whaha nou bedankt hoor yummieschater
//whahahaha het werkt nog ookschater
0
Berichten
13.482
Reputatie
0
Punten
0,00
Lid sinds
Laatst gezien
@Nickjexx; Jij snapt er volgens mij helemaal niets van? Want Josnl geeft gewoon de functie die jij zelf al gebruikt in je handler emoMaar als je meerdere woorden gebruikt, kan je die toch gewoon in de eerste handler erbij zetten?

[COLOR= #0000BB]<?php[/COLOR]
[COLOR= #007700]function[/COLOR] handler[COLOR= #007700]([/COLOR][COLOR= #0000BB]$str[/COLOR][COLOR= #007700]){[/COLOR]
[COLOR= #0000BB]$van[/COLOR] [COLOR= #007700]=[/COLOR] [URL="http://www.php.net/array"]array[/URL][COLOR= #007700]([/COLOR][COLOR= #DD0000]kip[/COLOR][COLOR= #007700],[/COLOR] [COLOR= #DD0000]ei[/COLOR][COLOR= #007700]);[/COLOR]
[COLOR= #0000BB]$naar[/COLOR] [COLOR= #007700]=[/COLOR] [URL="http://www.php.net/array"]array[/URL][COLOR= #007700]([/COLOR][COLOR= #DD0000]koe[/COLOR][COLOR= #007700],[/COLOR] [COLOR= #DD0000]vlaai[/COLOR][COLOR= #007700]);[/COLOR]
[COLOR= #0000BB]$str[/COLOR] [COLOR= #007700]=[/COLOR] [URL="http://www.php.net/str_replace"]str_replace[/URL][COLOR= #007700]([/COLOR][COLOR= #0000BB]$van[/COLOR][COLOR= #007700],[/COLOR] [COLOR= #0000BB]$naar[/COLOR][COLOR= #007700],[/COLOR] [COLOR= #0000BB]$str[/COLOR][COLOR= #007700]);[/COLOR]
[URL="http://www.php.net/return"]return[/URL] [COLOR= #0000BB]$str[/COLOR][COLOR= #007700];
}[/COLOR]
[URL="http://www.php.net/ob_start"]ob_start[/URL][COLOR= #007700]([/COLOR][COLOR= #DD0000]handler[/COLOR][COLOR= #007700]);[/COLOR]
?>
0
Marvinn

Lid · Topicstarter

Berichten
2.609
Reputatie
0
Punten
0,00
Lid sinds
Laatst gezien
Sjoerd schreef:
@Nickjexx; Jij snapt er volgens mij helemaal niets van? Want Josnl geeft gewoon de functie die jij zelf al gebruikt in je handler emoMaar als je meerdere woorden gebruikt, kan je die toch gewoon in de eerste handler erbij zetten?
[COLOR= #0000BB]<?php[/COLOR]
[COLOR= #007700]function[/COLOR] handler[COLOR= #007700]([/COLOR][COLOR= #0000BB]$str[/COLOR][COLOR= #007700]){[/COLOR]
[COLOR= #0000BB]$van[/COLOR] [COLOR= #007700]=[/COLOR] [URL="http://www.php.net/array"]array[/URL][COLOR= #007700]([/COLOR][COLOR= #DD0000]kip[/COLOR][COLOR= #007700],[/COLOR] [COLOR= #DD0000]ei[/COLOR][COLOR= #007700]);[/COLOR]
[COLOR= #0000BB]$naar[/COLOR] [COLOR= #007700]=[/COLOR] [URL="http://www.php.net/array"]array[/URL][COLOR= #007700]([/COLOR][COLOR= #DD0000]koe[/COLOR][COLOR= #007700],[/COLOR] [COLOR= #DD0000]vlaai[/COLOR][COLOR= #007700]);[/COLOR]
[COLOR= #0000BB]$str[/COLOR] [COLOR= #007700]=[/COLOR] [URL="http://www.php.net/str_replace"]str_replace[/URL][COLOR= #007700]([/COLOR][COLOR= #0000BB]$van[/COLOR][COLOR= #007700],[/COLOR] [COLOR= #0000BB]$naar[/COLOR][COLOR= #007700],[/COLOR] [COLOR= #0000BB]$str[/COLOR][COLOR= #007700]);[/COLOR]
[URL="http://www.php.net/return"]return[/URL] [COLOR= #0000BB]$str[/COLOR][COLOR= #007700];
}[/COLOR]
[URL="http://www.php.net/ob_start"]ob_start[/URL][COLOR= #007700]([/COLOR][COLOR= #DD0000]handler[/COLOR][COLOR= #007700]);[/COLOR]
?>


Nee laatmaar het werkt al denk ik yummie
0
Berichten
35.796
Reputatie
1
Punten
0,00
Lid sinds
Laatst gezien
Je moet al die ob_*()-meuk vermijden, dat heb je (vrijwel) nooit nodig als je een beetje normaal programmeert.
0
Marvinn

Lid · Topicstarter

Berichten
2.609
Reputatie
0
Punten
0,00
Lid sinds
Laatst gezien
Nouja kreeg het scriptje van iemand.
0
Berichten
8.649
Reputatie
0
Punten
0,00
Lid sinds
Laatst gezien
Je zei dat je geen UBB troep wou, maar dit word ook zo gedaan... Hangt er van af hoe je codeert.
0
Berichten
93.699
Reputatie
0
Punten
1,27
Lid sinds
Laatst gezien
Ik heb die "ob_*()-meuk" helaas wel nodig xd
0
Marvinn

Lid · Topicstarter

Berichten
2.609
Reputatie
0
Punten
0,00
Lid sinds
Laatst gezien
Vriendje schreef:
Je zei dat je geen UBB troep wou, maar dit word ook zo gedaan... Hangt er van af hoe je codeert.
Waarom bump je mijn topic?
0
Berichten
10.421
Reputatie
4
Punten
0,00
Lid sinds
Laatst gezien
ob_start() is leuk als je de hele pagina wilt bufferen, en te lui bent om de str_replace los te laten op een paar variabelen.
0

Jouw reactie

Deel je idee, stel een vraag of help een ander verder.

Editor laden…

Praat mee met de One2xs-community.

Inloggen om te reageren