Kleine Vragen Topic #1

Gestart doorLennard4.284 reacties15.585 weergaven

4.285 berichten · pagina 54 van 286

Berichten
10.421
Reputatie
4
Punten
0,00
Lid sinds
Laatst gezien
Dit mag niet van Lennart....
0
Berichten
20.364
Reputatie
0
Punten
0,00
Lid sinds
Laatst gezien
Sanderc schreef:
Eerdere citaten tonen
Gamedealer schreef:
Eerdere citaten tonen
Sanderc schreef:
Ik heb ergens gelezen dat je geen target blank kan doen in headers, klopt dat?
Wel jammer sadley
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
Ik heb dat al gebruikt, maar dat hoort in de HEAD, maar dan houd ik het wel bij header wink
//verkeerde array//Laa tmaar
Meta refresh hoeft niet in de HEAD hoor emoemo
0
Rik

Lid

Berichten
18.393
Reputatie
0
Punten
0,04
Lid sinds
Laatst gezien
Aarclay schreef:
Dit mag niet van Lennart....
Mag wel, mits je toestemming hebt gevraagd en gekregen.
0
Berichten
14.025
Reputatie
1
Punten
0,01
Lid sinds
Laatst gezien
[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?
0
Berichten
1.871
Reputatie
0
Punten
0,00
Lid sinds
Laatst gezien
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?
0
Berichten
14.025
Reputatie
1
Punten
0,01
Lid sinds
Laatst gezien
Nielsjojo schreef:
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?
Dat eerste functie ziet er goed uit, die 2e wat minder.
Wat doen al die UBB tags?

Idk.. Ik zag een Tutorial en die zei dat die 2e een goede functie is
0
Berichten
10.421
Reputatie
4
Punten
0,00
Lid sinds
Laatst gezien
Die xxs functie is zinloos. Waarom een nieuwe functie maken voor een bestaande functie?
0
Berichten
93.699
Reputatie
0
Punten
1,27
Lid sinds
Laatst gezien
Aarclay schreef:
Die xxs functie is zinloos. Waarom een nieuwe functie maken voor een bestaande functie?
Zeker luiheid om een paar letters meer te typen??
0
Berichten
10.421
Reputatie
4
Punten
0,00
Lid sinds
Laatst gezien
Raaoul schreef:
Eerdere citaten tonen
Aarclay schreef:
Die xxs functie is zinloos. Waarom een nieuwe functie maken voor een bestaande functie?
Zeker luiheid om een paar letters meer te typen??
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.
0
Ben

Lid

Berichten
4.598
Reputatie
0
Punten
0,00
Lid sinds
Laatst gezien
<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
0
Berichten
93.699
Reputatie
0
Punten
1,27
Lid sinds
Laatst gezien
Wel de afsluit comas op16 en 17

Deze ;
0
Ben

Lid

Berichten
4.598
Reputatie
0
Punten
0,00
Lid sinds
Laatst gezien
Sevvlor schreef:
Wel de afsluit comas op16 en 17

Deze ;
Oh emo oke dat was een domme fout, bedankt yummie
0
Berichten
6.485
Reputatie
0
Punten
0,00
Lid sinds
Laatst gezien
download eclipse-php (niet gewoon eclipse!). Dan krijg je dat soort fouten gelijk te zien.
0
Berichten
10.421
Reputatie
4
Punten
0,00
Lid sinds
Laatst gezien
Of netbeans-php wink
0
Berichten
3.112
Reputatie
0
Punten
0,00
Lid sinds
Laatst gezien
Is het mogelijk om te beveiligen tegen XSS maar toch de tekentjes normaal te laten zien?
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