Aarclay schreef:Misschien tof voor de anderen om ze open-source te maken d.m.v. php_highlight_string/file
Open-source? Hoe bedoel je?
toevoeging op 25 juni 2012, 15
31://Snap al, ik zal eens proberen
toevoeging op 25 juni 2012, 15
54:Nu heb ik dit met het BTW scripts geprobeerd:
[COLOR= #0000BB]<?php[/COLOR]
[COLOR= #FF8000]/*
*Copyright = Sander Corens
*Functie = Het berekenen van de BTW bij een bedrag en zeggen hoeveel de BTW is
*Versie = v1.3 | Gratis versie, niet doorverkopen of claimen als uw eigen
*/[/COLOR]
[URL="http://www.php.net/if"]if[/URL][COLOR= #007700]([/COLOR][COLOR= #0000BB]$_SERVER[/COLOR][COLOR= #007700][[/COLOR][COLOR= #DD0000]REQUEST_METHOD[/COLOR][COLOR= #007700]] ==[/COLOR] [COLOR= #DD0000]POST[/COLOR][COLOR= #007700]) {[/COLOR]
[URL="http://www.php.net/if"]if[/URL] [COLOR= #007700]([/COLOR][URL="http://www.php.net/empty"]empty[/URL][COLOR= #007700]([/COLOR][COLOR= #0000BB]$_POST[/COLOR][COLOR= #007700][[/COLOR][COLOR= #DD0000]bedrag[/COLOR][COLOR= #007700]])){[/COLOR]
[URL="http://www.php.net/echo"]echo[/URL] [COLOR= #DD0000]Je hebt het vakje voor het bedrag leeg gelaten![/COLOR][COLOR= #007700];
}[/COLOR][URL="http://www.php.net/elseif"]elseif[/URL][COLOR= #007700]([/COLOR][URL="http://www.php.net/empty"]empty[/URL][COLOR= #007700]([/COLOR][COLOR= #0000BB]$_POST[/COLOR][COLOR= #007700][[/COLOR][COLOR= #DD0000]btw[/COLOR][COLOR= #007700]])){[/COLOR]
[URL="http://www.php.net/echo"]echo[/URL][COLOR= #DD0000]Je hebt het vakje voor de BTW leeg gelaten![/COLOR][COLOR= #007700];
}[/COLOR][URL="http://www.php.net/elseif"]elseif[/URL] [COLOR= #007700](![/COLOR][URL="http://www.php.net/is_numeric"]is_numeric[/URL][COLOR= #007700]([/COLOR][COLOR= #0000BB]$_POST[/COLOR][COLOR= #007700][[/COLOR][COLOR= #DD0000]bedrag[/COLOR][COLOR= #007700]])) {[/COLOR]
[URL="http://www.php.net/echo"]echo[/URL][COLOR= #DD0000]Alleen gehele getallen invullen![/COLOR][COLOR= #007700];
}[/COLOR][URL="http://www.php.net/elseif"]elseif[/URL] [COLOR= #007700](![/COLOR][URL="http://www.php.net/is_numeric"]is_numeric[/URL][COLOR= #007700]([/COLOR][COLOR= #0000BB]$_POST[/COLOR][COLOR= #007700][[/COLOR][COLOR= #DD0000]btw[/COLOR][COLOR= #007700]])) {[/COLOR]
[URL="http://www.php.net/echo"]echo[/URL][COLOR= #DD0000]Alleen gehele getallen invullen![/COLOR][COLOR= #007700];
}[/COLOR][URL="http://www.php.net/elseif"]elseif[/URL] [COLOR= #007700]([/COLOR][COLOR= #0000BB]$_POST[/COLOR][COLOR= #007700][[/COLOR][COLOR= #DD0000]btw[/COLOR][COLOR= #007700]] >[/COLOR] [COLOR= #0000BB]100[/COLOR][COLOR= #007700]) {[/COLOR]
[URL="http://www.php.net/echo"]echo[/URL][COLOR= #DD0000]Je kan niet meer dan 100% BTW hebben![/COLOR][COLOR= #007700];
}[/COLOR][URL="http://www.php.net/else"]else[/URL][COLOR= #007700]{[/COLOR]
[COLOR= #0000BB]$totaal[/COLOR] [COLOR= #007700]=[/COLOR] [COLOR= #0000BB]$_POST[/COLOR][COLOR= #007700][[/COLOR][COLOR= #DD0000]bedrag[/COLOR][COLOR= #007700]][/COLOR] / [COLOR= #0000BB]100[/COLOR] [COLOR= #007700]*[/COLOR] [COLOR= #0000BB]$_POST[/COLOR][COLOR= #007700][[/COLOR][COLOR= #DD0000]btw[/COLOR][COLOR= #007700]];[/COLOR]
[COLOR= #0000BB]$totaalbtw[/COLOR] [COLOR= #007700]=[/COLOR] [COLOR= #0000BB]$totaal[/COLOR] [COLOR= #007700]+[/COLOR] [COLOR= #0000BB]$_POST[/COLOR][COLOR= #007700][[/COLOR][COLOR= #DD0000]bedrag[/COLOR][COLOR= #007700]];[/COLOR]
[URL="http://www.php.net/echo"]echo[/URL][COLOR= #DD0000]De btw bedraagd = [/COLOR][COLOR= #007700].[/COLOR][URL="http://www.php.net/number_format"]number_format[/URL][COLOR= #007700]([/COLOR][COLOR= #0000BB]$totaal[/COLOR][COLOR= #007700],[/COLOR] [COLOR= #0000BB]2[/COLOR][COLOR= #007700],[/COLOR] [COLOR= #DD0000],[/COLOR][COLOR= #007700],[/COLOR] [COLOR= #DD0000] [/COLOR][COLOR= #007700]).[/COLOR][COLOR= #DD0000] Euro<br/>[/COLOR][COLOR= #007700];[/COLOR]
[URL="http://www.php.net/echo"]echo[/URL][COLOR= #DD0000]Het bedrag met de BTW erbij = [/COLOR][COLOR= #007700].[/COLOR][URL="http://www.php.net/number_format"]number_format[/URL][COLOR= #007700]([/COLOR][COLOR= #0000BB]$totaalbtw[/COLOR][COLOR= #007700],[/COLOR] [COLOR= #0000BB]2[/COLOR][COLOR= #007700],[/COLOR] [COLOR= #DD0000],[/COLOR][COLOR= #007700],[/COLOR] [COLOR= #DD0000] [/COLOR][COLOR= #007700]).[/COLOR][COLOR= #DD0000] Euro[/COLOR][COLOR= #007700];
}
}[/COLOR][URL="http://www.php.net/else"]else[/URL][COLOR= #007700]{[/COLOR]
?>
<form action ="#" method="POST">
<input type="text" name="bedrag" placeholder="Bedrag"> //Je kan alleen nog maar gehele getallen invullen, kommagetallen gaat niet! Dit komt er in de volgende versie bij!<br/>
<input type="text" name="btw" placeholder="BTW"> %<br/>
<input type="submit" value="Bereken BTW" />
</form>
[COLOR= #0000BB]<?php[/COLOR]
[COLOR= #007700]}[/COLOR]
?>
<fieldset>
<legend> Code</legend>
[COLOR= #0000BB]<?php[/COLOR]
[URL="http://www.php.net/highlight_string"]highlight_string[/URL][COLOR= #007700]([/COLOR][COLOR= #DD0000]<?php
/*
*Copyright = Sander Corens
*Functie = Het berekenen van de BTW bij een bedrag en zeggen hoeveel de BTW is
*Versie = v1.3 | Gratis versie, niet doorverkopen of claimen als uw eigen
*/
if($_SERVER[[/COLOR]REQUEST_METHOD[COLOR= #DD0000]] == [/COLOR]POST[COLOR= #DD0000]) {
if (empty($_POST[[/COLOR]bedrag[COLOR= #DD0000]])){
echo [/COLOR]Je hebt het vakje voor het bedrag leeg gelaten[COLOR= #007700]![/COLOR][COLOR= #DD0000];
}elseif(empty($_POST[[/COLOR]btw[COLOR= #DD0000]])){
echo[/COLOR]Je hebt het vakje voor de BTW leeg gelaten[COLOR= #007700]![/COLOR][COLOR= #DD0000];
}elseif (!is_numeric($_POST[[/COLOR]bedrag[COLOR= #DD0000]])) {
echo[/COLOR]Alleen gehele getallen invullen[COLOR= #007700]![/COLOR][COLOR= #DD0000];
}elseif (!is_numeric($_POST[[/COLOR]btw[COLOR= #DD0000]])) {
echo[/COLOR]Alleen gehele getallen invullen[COLOR= #007700]![/COLOR][COLOR= #DD0000];
}elseif ($_POST[[/COLOR]btw[COLOR= #DD0000]] > 100) {
echo[/COLOR]Je kan niet meer dan [COLOR= #0000BB]100[/COLOR][COLOR= #007700]%[/COLOR] BTW hebben[COLOR= #007700]![/COLOR][COLOR= #DD0000];
}else{
$totaal = $_POST[[/COLOR]bedrag[COLOR= #DD0000]] / 100 * $_POST[[/COLOR]btw[COLOR= #DD0000]];
$totaalbtw = $totaal + $_POST[[/COLOR]bedrag[COLOR= #DD0000]];
echo[/COLOR]De btw bedraagd [COLOR= #007700]=[/COLOR] [COLOR= #DD0000].number_format($totaal, 2, [/COLOR][COLOR= #007700],[/COLOR][COLOR= #DD0000], ).[/COLOR] Euro[COLOR= #007700]<[/COLOR]br/[COLOR= #007700]>[/COLOR][COLOR= #DD0000];
echo[/COLOR]Het bedrag met de BTW erbij [COLOR= #007700]=[/COLOR] [COLOR= #DD0000].number_format($totaalbtw, 2, [/COLOR][COLOR= #007700],[/COLOR][COLOR= #DD0000], ).[/COLOR] Euro[COLOR= #DD0000];
}
}else{
?>
<form action ="#" method="POST">
<input type="text" name="bedrag" placeholder="Bedrag"> //Je kan alleen nog maar gehele getallen invullen, kommagetallen gaat niet! Dit komt er in de volgende versie bij!<br/>
<input type="text" name="btw" placeholder="BTW"> %<br/>
<input type="submit" value="Bereken BTW" />
</form>
<?php
}
?>[/COLOR][COLOR= #007700]);[/COLOR]
?>
</fieldset>
Maar deze error komt er

Parse error: syntax error, unexpected T_STRING in /home/dylanzk57/domains/dylanproductions.nl/public_html/sander/btp.php on line 43