preg replace

Gestart doorOne2xs6 reacties54 weergaven

7 berichten · pagina 1 van 1

One2xs

Bot · Topicstarter

Berichten
93.699
Reputatie
0
Punten
1,27
Lid sinds
Laatst gezien
ik hebben nu dit:

[COLOR= #0000BB]<?php
$_POST[/COLOR][COLOR= #007700][[/COLOR][COLOR= #DD0000]bericht[/COLOR][COLOR= #007700]] =[/COLOR] [URL="http://www.php.net/preg_replace"]preg_replace[/URL][COLOR= #007700]([/COLOR][COLOR= #DD0000]"#[kop](.*)[/kop]#is"[/COLOR][COLOR= #007700],[/COLOR] begintabel[COLOR= #007700]([/COLOR][COLOR= #DD0000]"\1"[/COLOR][COLOR= #007700]),[/COLOR] [COLOR= #0000BB]$_POST[/COLOR][COLOR= #007700][[/COLOR][COLOR= #DD0000]bericht[/COLOR][COLOR= #007700]]);[/COLOR]
?>


nu werkt het op 1 stukje na:
hij doet inplaats van wat er tussen [kop] en [/kop] 1 neerzetten
hoe los ik dit op?
0
Berichten
8.602
Reputatie
0
Punten
0,00
Lid sinds
Laatst gezien
[COLOR= #0000BB]<?php
$bericht[/COLOR] [COLOR= #007700]=[/COLOR] [COLOR= #0000BB]$_POST[/COLOR][COLOR= #007700][[/COLOR][COLOR= #DD0000]bericht[/COLOR][COLOR= #007700]];[/COLOR]
[COLOR= #0000BB]$bericht[/COLOR] [COLOR= #007700]=[/COLOR] [URL="http://www.php.net/preg_replace"]preg_replace[/URL][COLOR= #007700]([/COLOR][COLOR= #DD0000]"#[kop](.*?)[/kop]#is"[/COLOR][COLOR= #007700],[/COLOR] begintabel[COLOR= #007700]([/COLOR][COLOR= #DD0000]"1"[/COLOR][COLOR= #007700]),[/COLOR] [COLOR= #0000BB]$bericht[/COLOR][COLOR= #007700]);[/COLOR]
?>
0
One2xs

Bot · Topicstarter

Berichten
93.699
Reputatie
0
Punten
1,27
Lid sinds
Laatst gezien
werkt GVD nog niet ik heb nu al dit:

[COLOR= #0000BB]<?php[/COLOR]
[URL="http://www.php.net/include"]include[/URL][COLOR= #007700]([/COLOR][COLOR= #DD0000]"global.php"[/COLOR][COLOR= #007700]);[/COLOR]
[URL="http://www.php.net/include"]include[/URL][COLOR= #007700]([/COLOR][COLOR= #DD0000]"header.php"[/COLOR][COLOR= #007700]);
function[/COLOR] mailubb[COLOR= #007700]([/COLOR][COLOR= #0000BB]$bericht[/COLOR][COLOR= #007700]){[/COLOR]
    [COLOR= #0000BB]$bericht[/COLOR] [COLOR= #007700]=[/COLOR] [URL="http://www.php.net/preg_replace"]preg_replace[/URL][COLOR= #007700]([/COLOR][COLOR= #DD0000]"#[kop](.*?)[/kop]#is"[/COLOR][COLOR= #007700],[/COLOR] begintabel[COLOR= #007700]([/COLOR][COLOR= #DD0000]"1"[/COLOR][COLOR= #007700]),[/COLOR] [COLOR= #0000BB]$bericht[/COLOR][COLOR= #007700]);[/COLOR]
    [URL="http://www.php.net/return"]return[/URL] [COLOR= #0000BB]$bericht[/COLOR][COLOR= #007700];
}[/COLOR]
[URL="http://www.php.net/if"]if[/URL][COLOR= #007700]([/COLOR][COLOR= #0000BB]$_POST[/COLOR] [COLOR= #007700]&&[/COLOR] [COLOR= #0000BB]$_GET[/COLOR][COLOR= #007700]){[/COLOR]
    [URL="http://www.php.net/echo"]echo[/URL] mailubb[COLOR= #007700]([/COLOR][COLOR= #0000BB]$_POST[/COLOR][COLOR= #007700][[/COLOR][COLOR= #DD0000]bericht[/COLOR][COLOR= #007700]]);[/COLOR]
    [URL="http://www.php.net/echo"]echo[/URL][COLOR= #DD0000]U POSTE EN GETTE!![/COLOR][COLOR= #007700];
}[/COLOR][URL="http://www.php.net/else"]else[/URL][COLOR= #007700]{[/COLOR]
    begintabel[COLOR= #007700]([/COLOR][COLOR= #DD0000]"Admin - nieuwsbrief versturen"[/COLOR][COLOR= #007700]);[/COLOR]
?>
<form action="?verstuur=ja" method="POST">
<textarea name="bericht" cols="115" rows="25"></textarea>
<input name="submit" value="Verstuur nieuwsbrief!" style="width:100%;border-top:0px;" type="submit" />
</form>
[COLOR= #0000BB]<?php[/COLOR]
    eindetabel[COLOR= #007700]();
}[/COLOR]
[URL="http://www.php.net/include"]include[/URL][COLOR= #007700]([/COLOR][COLOR= #DD0000]"footer.php"[/COLOR][COLOR= #007700]);[/COLOR]
?>


maar nu krijg ik de hele tijd dat hij nu dus begintabel("1");
neerzet ook als het leeg is confused
0
Berichten
8.602
Reputatie
0
Punten
0,00
Lid sinds
Laatst gezien
Bij mij ubb parser werkt het wel?
0
One2xs

Bot · Topicstarter

Berichten
93.699
Reputatie
0
Punten
1,27
Lid sinds
Laatst gezien
bij mijne echt NIET
komt door de functie begintabel() misschien?
0
Berichten
18.482
Reputatie
0
Punten
0,00
Lid sinds
Laatst gezien
[COLOR= #0000BB]<?php[/COLOR]
[URL="http://www.php.net/include"]include[/URL][COLOR= #007700]([/COLOR][COLOR= #DD0000]"global.php"[/COLOR][COLOR= #007700]);[/COLOR]
[URL="http://www.php.net/include"]include[/URL][COLOR= #007700]([/COLOR][COLOR= #DD0000]"header.php"[/COLOR][COLOR= #007700]);
function[/COLOR] mailubb[COLOR= #007700]([/COLOR][COLOR= #0000BB]$bericht[/COLOR][COLOR= #007700]){[/COLOR]
    [COLOR= #0000BB]$bericht[/COLOR] [COLOR= #007700]=[/COLOR] [URL="http://www.php.net/preg_replace"]preg_replace[/URL][COLOR= #007700]([/COLOR][COLOR= #DD0000]"#[kop](.*?)[/kop]#is"[/COLOR][COLOR= #007700],[/COLOR] [COLOR= #DD0000]"begintabel(1)"[/COLOR][COLOR= #007700],[/COLOR] [COLOR= #0000BB]$bericht[/COLOR][COLOR= #007700]);[/COLOR]
    [URL="http://www.php.net/return"]return[/URL] [COLOR= #0000BB]$bericht[/COLOR][COLOR= #007700];
}[/COLOR]
[URL="http://www.php.net/if"]if[/URL][COLOR= #007700]([/COLOR][COLOR= #0000BB]$_POST[/COLOR] [COLOR= #007700]&&[/COLOR] [COLOR= #0000BB]$_GET[/COLOR][COLOR= #007700]){[/COLOR]
    [URL="http://www.php.net/echo"]echo[/URL] mailubb[COLOR= #007700]([/COLOR][COLOR= #0000BB]$_POST[/COLOR][COLOR= #007700][[/COLOR][COLOR= #DD0000]bericht[/COLOR][COLOR= #007700]]);[/COLOR]
    [URL="http://www.php.net/echo"]echo[/URL][COLOR= #DD0000]U POSTE EN GETTE!![/COLOR][COLOR= #007700];
}[/COLOR][URL="http://www.php.net/else"]else[/URL][COLOR= #007700]{[/COLOR]
    begintabel[COLOR= #007700]([/COLOR][COLOR= #DD0000]"Admin - nieuwsbrief versturen"[/COLOR][COLOR= #007700]);[/COLOR]
?>
<form action="?verstuur=ja" method="POST">
<textarea name="bericht" cols="115" rows="25"></textarea>
<input name="submit" value="Verstuur nieuwsbrief!" style="width:100%;border-top:0px;" type="submit" />
</form>
[COLOR= #0000BB]<?php[/COLOR]
    eindetabel[COLOR= #007700]();
}[/COLOR]
[URL="http://www.php.net/include"]include[/URL][COLOR= #007700]([/COLOR][COLOR= #DD0000]"footer.php"[/COLOR][COLOR= #007700]);[/COLOR]
?>


Probeer dat eens
0
One2xs

Bot · Topicstarter

Berichten
93.699
Reputatie
0
Punten
1,27
Lid sinds
Laatst gezien
nu werkt het wel maar roept hij de functie niet aan xd
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