Question: ```
file * fp = fopen()
file * fd = ????

```

I want to use `*fd` to write file which `*fp` opened before.

How can I do it?

Add some, the key of this question is use another pointer to do it. See, \*fd is the different pointer. Wish i made this clear.

Answer: 
`htmlentities()` is what you're looking for:

<http://uk3.php.net/manual/en/function.htmlentities.php>
Two issues:

(1) Use the htmlentities() located at <http://php.net/manual/en/function.htmlentities.php>

Basic usages:

```
$clean = htmlentities($dirty, ENT_QUOTES, "UTF-8");

```

The "ENT\_QUOTES" will result in both single and double quotes being converted (easy to change)

The "UTF-8" forces a UTF-8 char-set (important, read below)

(2) Force a charset on BOTH the form page and the submit-to page.

Just below your opening php brackets insert the following:

```
header('Content-Type: text/html; charset=utf-8');

```

It is important that you force a charset on both pages (realistically, on every page of your website.)

That should resolve the issues. If not, you have issues elsewhere within your purification system.