Hallo allemaal,
Ik heb sinds kort een berichtenbalk met smileys, probleem: de smilys werken net: in plaats van een smiley komt er te staan: <img src=http://www.all4mobile.net/balkie/... Dit komt dus door het "anti-html" van php.
Hier is het script van de balk:
Weet iemand toevallig hoe ik dus de afbeelding sources zo kan schrijven in php dat de smiley worden weergeven in plaats van de tekst...?
Ik heb sinds kort een berichtenbalk met smileys, probleem: de smilys werken net: in plaats van een smiley komt er te staan: <img src=http://www.all4mobile.net/balkie/... Dit komt dus door het "anti-html" van php.
Hier is het script van de balk:
PHP:
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
| <html> <head> <title>Untitled Document</title> <meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1"> </head> <body> <? $bericht = str_replace(":@","[img]http://www.all4mobile.net/balkie/smiley/angry.gif[/img]",$bericht); $bericht = str_replace(":D","[img]http://www.all4mobile.net/balkie/smiley/bigsmile.gif[/img]",$bericht); $bericht = str_replace(":s","[img]http://www.all4mobile.net/balkie/smiley/confused.gif[/img]",$bericht); $bericht = str_replace(";(","[img]http://www.all4mobile.net/balkie/smiley/cry.gif[/img]",$bericht); $bericht = str_replace(":)","[img]http://www.all4mobile.net/balkie/smiley/happy.gif[/img]",$bericht); $bericht = str_replace(":(","[img]http://www.all4mobile.net/balkie/smiley/sad.gif[/img]",$bericht); $bericht = str_replace(":|","[img]http://www.all4mobile.net/balkie/smiley/shock.gif[/img]",$bericht); $bericht = str_replace(":p","[img]http://www.all4mobile.net/balkie/smiley/tongue.gif[/img]",$bericht); $bericht = str_replace(";)","[img]http://www.all4mobile.net/balkie/smiley/wink.gif[/img]",$bericht); ?> <? //Anti-HTML $naam = htmlspecialchars($naam); $url = htmlspecialchars($url); $bericht = htmlspecialchars($bericht); $schijding = " : : : "; $data = "data.inc"; $file = fopen($data, "a+"); fputs($file, '<?php echo "$schijding <a href=$url target=_blank>$naam</a>: $bericht" ?>'); fclose($file); echo "Je bericht is succesvol toegevoegt!! <a href=index.php>Go-back</a>"; ?> </body> </html> |
Weet iemand toevallig hoe ik dus de afbeelding sources zo kan schrijven in php dat de smiley worden weergeven in plaats van de tekst...?