Dit mag niet van Lennart....
Kleine Vragen Topic #1
Sanderc schreef:Meta refresh hoeft niet in de HEAD hoorIk heb dat al gebruikt, maar dat hoort in de HEAD, maar dan houd ik het wel bij headerEerdere citaten tonen
Gamedealer schreef:Wel jammerEerdere citaten tonen
Sanderc schreef:Ik heb ergens gelezen dat je geen target blank kan doen in headers, klopt dat?
Klopt.
Je zou een meta refresh kunnen gebruiken met javascript (geen idee of het werkt):
http://stackoverflow.com/questions/2852154/open-html-meta-redirect-in-new-window
//verkeerde array//Laa tmaar


Aarclay schreef:Mag wel, mits je toestemming hebt gevraagd en gekregen.Dit mag niet van Lennart....
[COLOR= #0000BB]<?php[/COLOR]
[COLOR= #007700]function[/COLOR] xss[COLOR= #007700]([/COLOR][COLOR= #0000BB]$xss[/COLOR][COLOR= #007700]) {[/COLOR]
[URL="http://www.php.net/return"]return[/URL] htmlentities[COLOR= #007700]([/COLOR][COLOR= #0000BB]$xss[/COLOR][COLOR= #007700]);
}[/COLOR]
?> [COLOR= #0000BB]<?php[/COLOR]
[COLOR= #007700]function[/COLOR] goedfilter1[COLOR= #007700]([/COLOR][COLOR= #0000BB]$text[/COLOR][COLOR= #007700]){[/COLOR]
[COLOR= #0000BB]$text[/COLOR] [COLOR= #007700]=[/COLOR] [URL="http://www.php.net/stripslashes"]stripslashes[/URL][COLOR= #007700]([/COLOR][COLOR= #0000BB]$text[/COLOR][COLOR= #007700]);[/COLOR]
[COLOR= #FF8000]//transformeert eerst de "goede" tags naar hun bb versie, zodat ze door het strip_tags filter niet aangetast worden.[/COLOR]
[COLOR= #0000BB]$text[/COLOR] [COLOR= #007700]=[/COLOR] [URL="http://www.php.net/preg_replace"]preg_replace[/URL][COLOR= #007700]([/COLOR][COLOR= #DD0000]"(<img src="([a-z0-9_-./:]+?)"></img>)"[/COLOR][COLOR= #007700],[/COLOR] [COLOR= #DD0000]"[img]$1[/img]"[/COLOR][COLOR= #007700],[/COLOR] [COLOR= #0000BB]$text[/COLOR][COLOR= #007700]);[/COLOR]
[COLOR= #0000BB]$text[/COLOR] [COLOR= #007700]=[/COLOR] [URL="http://www.php.net/preg_replace"]preg_replace[/URL][COLOR= #007700]([/COLOR][COLOR= #DD0000]"(<b>(.+?)</b>)"[/COLOR][COLOR= #007700],[/COLOR] [COLOR= #DD0000]"[b]$1[/b]"[/COLOR][COLOR= #007700],[/COLOR] [COLOR= #0000BB]$text[/COLOR][COLOR= #007700]);[/COLOR]
[COLOR= #0000BB]$text[/COLOR] [COLOR= #007700]=[/COLOR] [URL="http://www.php.net/strip_tags"]strip_tags[/URL][COLOR= #007700]([/COLOR][COLOR= #0000BB]$text[/COLOR][COLOR= #007700]);[/COLOR]
[COLOR= #0000BB]$text[/COLOR] [COLOR= #007700]=[/COLOR] htmlentities[COLOR= #007700]([/COLOR][COLOR= #0000BB]$text[/COLOR][COLOR= #007700],[/COLOR] ENT_QUOTES[COLOR= #007700]);[/COLOR]
[COLOR= #0000BB]$text[/COLOR] [COLOR= #007700]=[/COLOR] [URL="http://www.php.net/preg_replace"]preg_replace[/URL][COLOR= #007700]([/COLOR][COLOR= #DD0000]([img]http://([a-z0-9_-./:]+?)[/(?:img)?])[/COLOR][COLOR= #007700],[/COLOR] [COLOR= #DD0000]<img src="http://$1">[/COLOR][COLOR= #007700],[/COLOR] [COLOR= #0000BB]$text[/COLOR][COLOR= #007700]);[/COLOR]
[COLOR= #0000BB]$text[/COLOR] [COLOR= #007700]=[/COLOR] [URL="http://www.php.net/preg_replace"]preg_replace[/URL][COLOR= #007700]([/COLOR][COLOR= #DD0000]([img]([a-z0-9_-./:]+?)[/(?:img)?])[/COLOR][COLOR= #007700],[/COLOR] [COLOR= #DD0000]<img src="http://$1">[/COLOR][COLOR= #007700],[/COLOR] [COLOR= #0000BB]$text[/COLOR][COLOR= #007700]);[/COLOR]
[COLOR= #0000BB]$text[/COLOR] [COLOR= #007700]=[/COLOR] [URL="http://www.php.net/preg_replace"]preg_replace[/URL][COLOR= #007700]([/COLOR][COLOR= #DD0000]([b](.+?)[/b])[/COLOR][COLOR= #007700],[/COLOR] [COLOR= #DD0000]<b>$1</b>[/COLOR][COLOR= #007700],[/COLOR] [COLOR= #0000BB]$text[/COLOR][COLOR= #007700]);[/COLOR]
[URL="http://www.php.net/return"]return[/URL] [COLOR= #0000BB]$text[/COLOR][COLOR= #007700];
}[/COLOR]
?> Welke is beter? En wat is het verschil?
Dylanh schreef:[COLOR= #0000BB]<?php[/COLOR] [COLOR= #007700]function[/COLOR] xss[COLOR= #007700]([/COLOR][COLOR= #0000BB]$xss[/COLOR][COLOR= #007700]) {[/COLOR] [URL="http://www.php.net/return"]return[/URL] htmlentities[COLOR= #007700]([/COLOR][COLOR= #0000BB]$xss[/COLOR][COLOR= #007700]); }[/COLOR] ?>
[COLOR= #0000BB]<?php[/COLOR]
[COLOR= #007700]function[/COLOR] goedfilter1[COLOR= #007700]([/COLOR][COLOR= #0000BB]$text[/COLOR][COLOR= #007700]){[/COLOR]
[COLOR= #0000BB]$text[/COLOR] [COLOR= #007700]=[/COLOR] [URL="http://www.php.net/stripslashes"]stripslashes[/URL][COLOR= #007700]([/COLOR][COLOR= #0000BB]$text[/COLOR][COLOR= #007700]);[/COLOR]
[COLOR= #FF8000]//transformeert eerst de "goede" tags naar hun bb versie, zodat ze door het strip_tags filter niet aangetast worden.[/COLOR]
[COLOR= #0000BB]$text[/COLOR] [COLOR= #007700]=[/COLOR] [URL="http://www.php.net/preg_replace"]preg_replace[/URL][COLOR= #007700]([/COLOR][COLOR= #DD0000]"(<img src="([a-z0-9_-./:]+?)"></img>)"[/COLOR][COLOR= #007700],[/COLOR] [COLOR= #DD0000]"[url=$1]Afbeelding[/url]"[/COLOR][COLOR= #007700],[/COLOR] [COLOR= #0000BB]$text[/COLOR][COLOR= #007700]);[/COLOR]
[COLOR= #0000BB]$text[/COLOR] [COLOR= #007700]=[/COLOR] [URL="http://www.php.net/preg_replace"]preg_replace[/URL][COLOR= #007700]([/COLOR][COLOR= #DD0000]"(<b>(.+?)</b>)"[/COLOR][COLOR= #007700],[/COLOR] [COLOR= #DD0000]"[b]$1[/b]"[/COLOR][COLOR= #007700],[/COLOR] [COLOR= #0000BB]$text[/COLOR][COLOR= #007700]);[/COLOR]
[COLOR= #0000BB]$text[/COLOR] [COLOR= #007700]=[/COLOR] [URL="http://www.php.net/strip_tags"]strip_tags[/URL][COLOR= #007700]([/COLOR][COLOR= #0000BB]$text[/COLOR][COLOR= #007700]);[/COLOR]
[COLOR= #0000BB]$text[/COLOR] [COLOR= #007700]=[/COLOR] htmlentities[COLOR= #007700]([/COLOR][COLOR= #0000BB]$text[/COLOR][COLOR= #007700],[/COLOR] ENT_QUOTES[COLOR= #007700]);[/COLOR]
[COLOR= #0000BB]$text[/COLOR] [COLOR= #007700]=[/COLOR] [URL="http://www.php.net/preg_replace"]preg_replace[/URL][COLOR= #007700]([/COLOR][COLOR= #DD0000]([img]http://([a-z0-9_-./:]+?)[/(?:img)?])[/COLOR][COLOR= #007700],[/COLOR] [COLOR= #DD0000]<img src="http://$1">[/COLOR][COLOR= #007700],[/COLOR] [COLOR= #0000BB]$text[/COLOR][COLOR= #007700]);[/COLOR]
[COLOR= #0000BB]$text[/COLOR] [COLOR= #007700]=[/COLOR] [URL="http://www.php.net/preg_replace"]preg_replace[/URL][COLOR= #007700]([/COLOR][COLOR= #DD0000]([img]([a-z0-9_-./:]+?)[/(?:img)?])[/COLOR][COLOR= #007700],[/COLOR] [COLOR= #DD0000]<img src="http://$1">[/COLOR][COLOR= #007700],[/COLOR] [COLOR= #0000BB]$text[/COLOR][COLOR= #007700]);[/COLOR]
[COLOR= #0000BB]$text[/COLOR] [COLOR= #007700]=[/COLOR] [URL="http://www.php.net/preg_replace"]preg_replace[/URL][COLOR= #007700]([/COLOR][COLOR= #DD0000]([b](.+?)[/b])[/COLOR][COLOR= #007700],[/COLOR] [COLOR= #DD0000]<b>$1</b>[/COLOR][COLOR= #007700],[/COLOR] [COLOR= #0000BB]$text[/COLOR][COLOR= #007700]);[/COLOR]
[URL="http://www.php.net/return"]return[/URL] [COLOR= #0000BB]$text[/COLOR][COLOR= #007700];
}[/COLOR]
?> Welke is beter? En wat is het verschil?
Dat eerste functie ziet er goed uit, die 2e wat minder.
Wat doen al die UBB tags?
Nielsjojo schreef:Dat eerste functie ziet er goed uit, die 2e wat minder.Eerdere citaten tonen
Dylanh schreef:[COLOR= #0000BB]<?php[/COLOR] [COLOR= #007700]function[/COLOR] xss[COLOR= #007700]([/COLOR][COLOR= #0000BB]$xss[/COLOR][COLOR= #007700]) {[/COLOR] [URL="http://www.php.net/return"]return[/URL] htmlentities[COLOR= #007700]([/COLOR][COLOR= #0000BB]$xss[/COLOR][COLOR= #007700]); }[/COLOR] ?>[COLOR= #0000BB]<?php[/COLOR] [COLOR= #007700]function[/COLOR] goedfilter1[COLOR= #007700]([/COLOR][COLOR= #0000BB]$text[/COLOR][COLOR= #007700]){[/COLOR] [COLOR= #0000BB]$text[/COLOR] [COLOR= #007700]=[/COLOR] [URL="http://www.php.net/stripslashes"]stripslashes[/URL][COLOR= #007700]([/COLOR][COLOR= #0000BB]$text[/COLOR][COLOR= #007700]);[/COLOR] [COLOR= #FF8000]//transformeert eerst de "goede" tags naar hun bb versie, zodat ze door het strip_tags filter niet aangetast worden.[/COLOR] [COLOR= #0000BB]$text[/COLOR] [COLOR= #007700]=[/COLOR] [URL="http://www.php.net/preg_replace"]preg_replace[/URL][COLOR= #007700]([/COLOR][COLOR= #DD0000]"(<img src="([a-z0-9_-./:]+?)"></img>)"[/COLOR][COLOR= #007700],[/COLOR] [COLOR= #DD0000]"[url=$1]Afbeelding[/url]"[/COLOR][COLOR= #007700],[/COLOR] [COLOR= #0000BB]$text[/COLOR][COLOR= #007700]);[/COLOR] [COLOR= #0000BB]$text[/COLOR] [COLOR= #007700]=[/COLOR] [URL="http://www.php.net/preg_replace"]preg_replace[/URL][COLOR= #007700]([/COLOR][COLOR= #DD0000]"(<b>(.+?)</b>)"[/COLOR][COLOR= #007700],[/COLOR] [COLOR= #DD0000]"[b]$1[/b]"[/COLOR][COLOR= #007700],[/COLOR] [COLOR= #0000BB]$text[/COLOR][COLOR= #007700]);[/COLOR] [COLOR= #0000BB]$text[/COLOR] [COLOR= #007700]=[/COLOR] [URL="http://www.php.net/strip_tags"]strip_tags[/URL][COLOR= #007700]([/COLOR][COLOR= #0000BB]$text[/COLOR][COLOR= #007700]);[/COLOR] [COLOR= #0000BB]$text[/COLOR] [COLOR= #007700]=[/COLOR] htmlentities[COLOR= #007700]([/COLOR][COLOR= #0000BB]$text[/COLOR][COLOR= #007700],[/COLOR] ENT_QUOTES[COLOR= #007700]);[/COLOR] [COLOR= #0000BB]$text[/COLOR] [COLOR= #007700]=[/COLOR] [URL="http://www.php.net/preg_replace"]preg_replace[/URL][COLOR= #007700]([/COLOR][COLOR= #DD0000]([img]http://([a-z0-9_-./:]+?)[/(?:img)?])[/COLOR][COLOR= #007700],[/COLOR] [COLOR= #DD0000]<img src="http://$1">[/COLOR][COLOR= #007700],[/COLOR] [COLOR= #0000BB]$text[/COLOR][COLOR= #007700]);[/COLOR] [COLOR= #0000BB]$text[/COLOR] [COLOR= #007700]=[/COLOR] [URL="http://www.php.net/preg_replace"]preg_replace[/URL][COLOR= #007700]([/COLOR][COLOR= #DD0000]([img]([a-z0-9_-./:]+?)[/(?:img)?])[/COLOR][COLOR= #007700],[/COLOR] [COLOR= #DD0000]<img src="http://$1">[/COLOR][COLOR= #007700],[/COLOR] [COLOR= #0000BB]$text[/COLOR][COLOR= #007700]);[/COLOR] [COLOR= #0000BB]$text[/COLOR] [COLOR= #007700]=[/COLOR] [URL="http://www.php.net/preg_replace"]preg_replace[/URL][COLOR= #007700]([/COLOR][COLOR= #DD0000]([b](.+?)[/b])[/COLOR][COLOR= #007700],[/COLOR] [COLOR= #DD0000]<b>$1</b>[/COLOR][COLOR= #007700],[/COLOR] [COLOR= #0000BB]$text[/COLOR][COLOR= #007700]);[/COLOR] [URL="http://www.php.net/return"]return[/URL] [COLOR= #0000BB]$text[/COLOR][COLOR= #007700]; }[/COLOR] ?>
Welke is beter? En wat is het verschil?
Wat doen al die UBB tags?
Idk.. Ik zag een Tutorial en die zei dat die 2e een goede functie is
Die xxs functie is zinloos. Waarom een nieuwe functie maken voor een bestaande functie?
Aarclay schreef:Zeker luiheid om een paar letters meer te typen??Die xxs functie is zinloos. Waarom een nieuwe functie maken voor een bestaande functie?
Raaoul schreef:Dat zal het wel zijn, elke goede editor heeft wel functie-aanvulling, dus met drie tekens, pijltje en een enter kan je al de htmlentities() functie gebruiken.Zeker luiheid om een paar letters meer te typen??Eerdere citaten tonen
Aarclay schreef:Die xxs functie is zinloos. Waarom een nieuwe functie maken voor een bestaande functie?
<html>
<head>
<title>Mijn eerste PHP pagina</title>
</head>
<body>
[COLOR= #0000BB]<?php[/COLOR]
[URL="http://www.php.net/echo"]echo[/URL] [COLOR= #DD0000]Hello world <br />[/COLOR][COLOR= #007700];[/COLOR]
[COLOR= #0000BB]$tekst[/COLOR] [COLOR= #007700]=[/COLOR] [COLOR= #DD0000]Hello world 1 <br /><br />[/COLOR][COLOR= #007700];[/COLOR]
[URL="http://www.php.net/echo"]echo[/URL] [COLOR= #0000BB]$tekst[/COLOR][COLOR= #007700];[/COLOR]
?>
[COLOR= #0000BB]<?php
$tekst[/COLOR] [COLOR= #007700]=[/COLOR] [COLOR= #DD0000]hello world 2[/COLOR][COLOR= #007700];[/COLOR] [COLOR= #FF8000]// tekst bevat een string[/COLOR]
[COLOR= #0000BB]$leeftijd[/COLOR] [COLOR= #007700]=[/COLOR] [COLOR= #0000BB]20[/COLOR][COLOR= #007700];[/COLOR] [COLOR= #FF8000]//getallen in een variabale zijn integers[/COLOR]
[COLOR= #0000BB]$prijs[/COLOR] [COLOR= #007700]=[/COLOR] [COLOR= #0000BB]135.75[/COLOR] [COLOR= #FF8000]//getallen decimaal in een variabele zijn floats[/COLOR]
[COLOR= #0000BB]$check[/COLOR] [COLOR= #007700]=[/COLOR] true [COLOR= #FF8000]//een variabele die weergeeft of iets waar is of niet, boolean
//Naamgeving van variabelen is belangrijk, geef een nuttige naam aan je variabele
//Onderstaande variabelen zijn makkelijker en nuttiger dan bovenstaande variabelen[/COLOR]
[COLOR= #0000BB]$stekst[/COLOR] [COLOR= #007700]=[/COLOR] [COLOR= #DD0000]hello world 3[/COLOR][COLOR= #007700];[/COLOR] [COLOR= #FF8000]// s staat voor string in je variabele[/COLOR]
[COLOR= #0000BB]$ileeftijd[/COLOR] [COLOR= #007700]=[/COLOR] [COLOR= #0000BB]20[/COLOR][COLOR= #007700];[/COLOR] [COLOR= #FF8000]// i staat voor integer in je variabele[/COLOR]
[COLOR= #0000BB]$fprijs[/COLOR] [COLOR= #007700]=[/COLOR] [COLOR= #0000BB]135.75[/COLOR][COLOR= #007700];[/COLOR] [COLOR= #FF8000]// f staat voor float in je variabele[/COLOR]
[COLOR= #0000BB]$bcheck[/COLOR] [COLOR= #007700]=[/COLOR] true [COLOR= #FF8000]// b staat voor boolean in je variabele
//zo breng je commentaar aan
# zo breng je commentaar aan
/* zo breng je commentaar aan
dat over meerde regels kan
verspreid worden */[/COLOR]
?>
[COLOR= #0000BB]<?php
$sWelkomstekst[/COLOR] [COLOR= #007700]=[/COLOR] [COLOR= #DD0000]dag wereld[/COLOR][COLOR= #007700];[/COLOR]
[URL="http://www.php.net/echo"]echo[/URL] [COLOR= #DD0000]Dit is de welkomstekst: [/COLOR][COLOR= #007700].[/COLOR][COLOR= #0000BB]$sWelkomstekst[/COLOR][COLOR= #007700].[/COLOR][COLOR= #DD0000]<br />[/COLOR][COLOR= #007700];[/COLOR]
?>
</body>
</html> Komt rechtstreeks van een tut...
en:
Quote:
Parse error: syntax error, unexpected T_VARIABLE in /home/luukwolf/domains/run-samp.com/public_html/learnphp.php on line 17
Wel de afsluit comas op16 en 17
Deze ;
Deze ;
Sevvlor schreef:OhWel de afsluit comas op16 en 17
Deze ;
oke dat was een domme fout, bedankt 
download eclipse-php (niet gewoon eclipse!). Dan krijg je dat soort fouten gelijk te zien.
Of netbeans-php 

Is het mogelijk om te beveiligen tegen XSS maar toch de tekentjes normaal te laten zien?
