Lennard schreef:Al gedaan. ik had allemaal errors maar ik denk dat dat komt omdat de sessie zo is:Probeer het uit.
$_SESSION[user][id]
Lennard schreef:Al gedaan. ik had allemaal errors maar ik denk dat dat komt omdat de sessie zo is:Probeer het uit.
Jvdw schreef:Maak het zelf?ik snap er niets meer van, is er niet iets dat ik wel punten, uitroeptekens, vraagtekens kan toelaten en cijfers maar derest niet?
Jvdw schreef:gebruik deze functie:ik snap er niets meer van, is er niet iets dat ik wel punten, uitroeptekens, vraagtekens kan toelaten en cijfers maar derest niet?

Dylanh schreef:Dit heeft er niks mee te maken?gebruik deze functie:Eerdere citaten tonen
Jvdw schreef:ik snap er niets meer van, is er niet iets dat ik wel punten, uitroeptekens, vraagtekens kan toelaten en cijfers maar derest niet?
function xss($xss) {
return stripslashes(htmlentities($xss, ENT_QUOTES));
}
toevoeging op 28 juli 2012, 14:01:32:
werkt bij mij nu ook
Gamedealer schreef:idk hoe het moet, daarom vraag ik het hierMaak het zelf?Eerdere citaten tonen
Jvdw schreef:ik snap er niets meer van, is er niet iets dat ik wel punten, uitroeptekens, vraagtekens kan toelaten en cijfers maar derest niet?

Jvdw schreef:Maak een functie waarin je alle toegestane tekens in een array zet, dan kijk je of een teken in die array zit, en zoniet verwijder je hem?idk hoe het moet, daarom vraag ik het hierEerdere citaten tonen
Gamedealer schreef:Maak het zelf?Eerdere citaten tonen
Jvdw schreef:ik snap er niets meer van, is er niet iets dat ik wel punten, uitroeptekens, vraagtekens kan toelaten en cijfers maar derest niet?
[COLOR= #0000BB]<?php[/COLOR]
[COLOR= #007700]function[/COLOR] strip[COLOR= #007700]([/COLOR][COLOR= #0000BB]$var[/COLOR][COLOR= #007700]) {[/COLOR]
[COLOR= #0000BB]$alpha_tokens[/COLOR] [COLOR= #007700]=[/COLOR] [URL="http://www.php.net/array"]array[/URL][COLOR= #007700]([/COLOR][COLOR= #DD0000]"."[/COLOR][COLOR= #007700],[/COLOR] [COLOR= #DD0000]"?"[/COLOR][COLOR= #007700],[/COLOR] [COLOR= #DD0000]"!"[/COLOR][COLOR= #007700],[/COLOR] [COLOR= #DD0000]"0"[/COLOR][COLOR= #007700],[/COLOR] [COLOR= #DD0000]"1"[/COLOR][COLOR= #007700],[/COLOR] [COLOR= #DD0000]"2"[/COLOR][COLOR= #007700],[/COLOR] [COLOR= #DD0000]"3"[/COLOR][COLOR= #007700],[/COLOR] [COLOR= #DD0000]"4"[/COLOR][COLOR= #007700],[/COLOR] [COLOR= #DD0000]"5"[/COLOR][COLOR= #007700],[/COLOR] [COLOR= #DD0000]"6"[/COLOR][COLOR= #007700],[/COLOR] [COLOR= #DD0000]"7"[/COLOR][COLOR= #007700],[/COLOR] [COLOR= #DD0000]"8"[/COLOR][COLOR= #007700],[/COLOR] [COLOR= #DD0000]"9"[/COLOR][COLOR= #007700]);[/COLOR] [COLOR= #FF8000]//Toegestane tekens[/COLOR]
[URL="http://www.php.net/for"]for[/URL] [COLOR= #007700]([/COLOR][COLOR= #0000BB]$i[/COLOR] [COLOR= #007700]=[/COLOR] [COLOR= #0000BB]0[/COLOR][COLOR= #007700];[/COLOR] [COLOR= #0000BB]$i[/COLOR] [COLOR= #007700]<=[/COLOR] [URL="http://www.php.net/strlen"]strlen[/URL][COLOR= #007700]([/COLOR][COLOR= #0000BB]$var[/COLOR][COLOR= #007700]);[/COLOR] [COLOR= #0000BB]$i[/COLOR][COLOR= #007700]++) {[/COLOR]
[COLOR= #0000BB]$token[/COLOR] [COLOR= #007700]=[/COLOR] [URL="http://www.php.net/substr"]substr[/URL][COLOR= #007700]([/COLOR][COLOR= #0000BB]$var[/COLOR][COLOR= #007700],[/COLOR][COLOR= #0000BB]$i[/COLOR][COLOR= #007700],[/COLOR] [COLOR= #0000BB]1[/COLOR][COLOR= #007700]);[/COLOR]
[URL="http://www.php.net/if"]if[/URL][COLOR= #007700]([/COLOR][URL="http://www.php.net/in_array"]in_array[/URL][COLOR= #007700]([/COLOR][COLOR= #0000BB]$token[/COLOR][COLOR= #007700],[/COLOR] [COLOR= #0000BB]$alpha_tokens[/COLOR][COLOR= #007700])) {[/COLOR]
[COLOR= #0000BB]$characters[/COLOR][COLOR= #007700][] =[/COLOR] [COLOR= #0000BB]$token[/COLOR][COLOR= #007700];
}
}[/COLOR]
[URL="http://www.php.net/foreach"]foreach[/URL][COLOR= #007700]([/COLOR][COLOR= #0000BB]$characters[/COLOR] [COLOR= #007700]as[/COLOR] [COLOR= #0000BB]$letter[/COLOR][COLOR= #007700]) {[/COLOR]
[COLOR= #0000BB]$woord[/COLOR] [COLOR= #007700].=[/COLOR] [COLOR= #0000BB]$letter[/COLOR][COLOR= #007700];
}[/COLOR]
[URL="http://www.php.net/return"]return[/URL] [COLOR= #0000BB]$woord[/COLOR][COLOR= #007700];
}[/COLOR]
[COLOR= #FF8000]//Voorbeeld:[/COLOR]
[URL="http://www.php.net/echo"]echo[/URL] strip[COLOR= #007700]([/COLOR][COLOR= #DD0000]Aphlas.2930123?!!u2938u4jlksDF[/COLOR][COLOR= #007700]);[/COLOR]
?>Rogier schreef:Dan zou je dit moeten gebruiken?@hierboven: een regex is sowieso beter. Kijk eens op regexr.
preg_match (/^[0-9.!?]+$/, $var)) [COLOR= #0000BB]<?php
$usuario[/COLOR] [COLOR= #007700]=[/COLOR] [COLOR= #DD0000]habbotjes_staff[/COLOR][COLOR= #007700];[/COLOR] [COLOR= #FF8000]// Usuário do Twitter[/COLOR]
[COLOR= #0000BB]$feed[/COLOR] [COLOR= #007700]=[/COLOR] [COLOR= #DD0000]http://twitter.com/statuses/user_timeline/[/COLOR][COLOR= #007700].[/COLOR][COLOR= #0000BB]$usuario[/COLOR][COLOR= #007700].[/COLOR][COLOR= #DD0000].rss[/COLOR][COLOR= #007700];[/COLOR] [COLOR= #FF8000]// Apenas o URL do Feed[/COLOR]
[COLOR= #0000BB]$limite[/COLOR] [COLOR= #007700]=[/COLOR] [COLOR= #0000BB]10[/COLOR][COLOR= #007700];[/COLOR] [COLOR= #FF8000]// Limite te Tweets que aparecerão na tela[/COLOR]
?>
<html>
<head>
<title>Tweets de <?=$usuario;?></title>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
</head>
<body>
[COLOR= #0000BB]<?php
$conta[/COLOR][COLOR= #007700]=[/COLOR][COLOR= #0000BB]0[/COLOR][COLOR= #007700];[/COLOR]
[URL="http://www.php.net/foreach"]foreach[/URL][COLOR= #007700]([/COLOR]simplexml_load_file[COLOR= #007700]([/COLOR][COLOR= #0000BB]$feed[/COLOR][COLOR= #007700])->[/COLOR]channel[COLOR= #007700]->[/COLOR]item [COLOR= #007700]as[/COLOR] [COLOR= #0000BB]$item[/COLOR] [COLOR= #007700]):[/COLOR] [URL="http://www.php.net/if"]if[/URL][COLOR= #007700]([/COLOR][COLOR= #0000BB]$conta[/COLOR][COLOR= #007700]>=[/COLOR][COLOR= #0000BB]$limite[/COLOR][COLOR= #007700]){[/COLOR][URL="http://www.php.net/break"]break[/URL][COLOR= #007700];}[/COLOR] [COLOR= #0000BB]$conta[/COLOR][COLOR= #007700]++;[/COLOR]
[COLOR= #0000BB]$username[/COLOR] [COLOR= #007700]=[/COLOR] [COLOR= #0000BB]$usuario[/COLOR][COLOR= #007700];[/COLOR]
[COLOR= #0000BB]$nome[/COLOR] [COLOR= #007700]=[/COLOR] [URL="http://www.php.net/explode"]explode[/URL][COLOR= #007700]([/COLOR][COLOR= #DD0000]:[/COLOR][COLOR= #007700],[/COLOR][COLOR= #0000BB]$item[/COLOR][COLOR= #007700]->[/COLOR]title[COLOR= #007700]);[/COLOR] [COLOR= #0000BB]$nome[/COLOR] [COLOR= #007700]=[/COLOR] [COLOR= #0000BB]$nome[/COLOR][COLOR= #007700][[/COLOR][COLOR= #0000BB]0[/COLOR][COLOR= #007700]];[/COLOR]
[COLOR= #0000BB]$link[/COLOR] [COLOR= #007700]=[/COLOR] [COLOR= #0000BB]$item[/COLOR][COLOR= #007700]->[/COLOR][URL="http://www.php.net/link"]link[/URL][COLOR= #007700];[/COLOR]
[COLOR= #0000BB]$data[/COLOR] [COLOR= #007700]=[/COLOR] [COLOR= #0000BB]$item[/COLOR][COLOR= #007700]->[/COLOR]pubDate[COLOR= #007700];[/COLOR]
[COLOR= #0000BB]$tweet[/COLOR] [COLOR= #007700]=[/COLOR] [URL="http://www.php.net/str_replace"]str_replace[/URL][COLOR= #007700]([/COLOR][COLOR= #0000BB]$nome[/COLOR][COLOR= #007700].[/COLOR][COLOR= #DD0000]: [/COLOR][COLOR= #007700],[/COLOR][COLOR= #DD0000][/COLOR][COLOR= #007700],[/COLOR][COLOR= #0000BB]$item[/COLOR][COLOR= #007700]->[/COLOR]description[COLOR= #007700]);[/COLOR]
?>
<div id="tweet<?=$conta;?>">
<a target="_blank" href="http://twitter.com/<?=$username;?>"><img src="http://api.twitter.com/1/users/profile_image/<?=$username;?>" border="0" style="float:left; padding:3px;" width="48" height="48" title="@<?=$username;?>" /></a><a title="@<?=$username;?>" target="_blank" href="http://twitter.com/<?=$username;?>"><b><?=$nome;?></b></a>: <?=$tweet;?>
<br>
<small><span><a href="<?=$link;?>" target="_blank" style="color:#444444; text-decoration:none;"><?=$data;?></a></span></small>
</div>
<div style="clear:both;"></div>
[COLOR= #0000BB]<?php[/COLOR]
endforeach[COLOR= #007700];[/COLOR]
?>
</body>
</html> <div id="tweet<?=$conta;?>">
<a target="_blank" href="http://twitter.com/<?=$username;?>"><img src="http://api.twitter.com/1/users/profile_image/<?=$username;?>" border="0" style="float:left; padding:3px;" width="48" height="48" title="@<?=$username;?>" /></a><a title="@<?=$username;?>" target="_blank" href="http://twitter.com/<?=$username;?>"><b><?=$nome;?></b></a>: <?=$tweet;?>
<br>
<small><span><a href="<?=$link;?>" target="_blank" style="color:#444444; text-decoration:none;"><?=$data;?></a></span></small>
</div>
<div style="clear:both;"></div> Gamedealer schreef:Dan werken deze dingen niet meer:Maak er een string van en zet hem in een query?