# Ampersand problem

**URL:** <https://forum.kirupa.com/t/ampersand-problem/244107>\
**Category:** Uncategorized\
**Created:** [November 14, 2007, 11:11am UTC](https://forum.kirupa.com/t/ampersand-problem/244107 "2007-11-14T11:11:36Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![ostmalm](https://avatars.discourse-cdn.com/v4/letter/o/dfb087/32.png) [@ostmalm](https://forum.kirupa.com/u/ostmalm)\
**Post date:** [November 14, 2007, 11:11am UTC](https://forum.kirupa.com/t/ampersand-problem/244107/1 "2007-11-14T11:11:36Z")

</div>

hello kirupians

i really appreciate your help

first of all i don’t know anything about php / shame on me and yes i searched the forums

i’m using a flash based shoutbox ( .php writing to and reading from an xml file ) works fine BUT as expected if your comment includes stuff like ampersand the whole comment box gets wiped out.

i suppose there has to be a line in the .php file replacing the ampersand with a different character or word like “and” / like a bad word filter  
here is the php file

```php

<?
$txt=fopen("clubshout.xml","r");  
$gbfile="";
while($line=fgets($txt,1000))
$gbfile.=$line;
$name=stripslashes(strip_tags($name));
$comment=stripslashes(strip_tags($comment));
$gbfile="<u>$name </u>".date("<u>d.m.Y</u>")."<u>, </u>".date("<u>H:i</u>")."<u> h </u>"."
$comment
".$gbfile;
fclose($txt);
$txt=fopen("clubshout.xml","w");    
fputs($txt,$gbfile);
?>

```

thank you for reading
