raj escribió:
I'm using this code to import some a .txt files onto a webpage, but I
keep seeing single quotes amd double quotes as question marks.
Here's the code:
<textarea disabled="disabled" name="textarea2" cols="70" rows="7"
wrap="virtual"><?php addslashes(include("../license/license.txt")); ?>
</textarea>
I'd say you've written license.txt with some word processor like
Microsoft Word and it uses quotes like “foo” and ‘bar’ (rather than
"foo" and 'bar'). You must convert the file into whatever charset your
site uses (typically ISO-8859-1 or UTF-8, but I can't assure). If you
don't have a good text editor that can do it for you, you can use
iconv() in PHP. Or simple change the quotes manually.
Also, you must replace < and with < and > entities. You can use
htmlspecialchars() for the task but you can't apply functions to the
output of include! You need to fetch the file with a function that
returns a string, such as file_get_contents().
--
--
http://alvaro.es - Álvaro G. Vicario - Burgos, Spain
-- Mi sitio sobre programación web:
http://bits.demogracia.com
-- Mi web de humor al baño María:
http://www.demogracia.com
--