|
|
|
|
||||||
![]() |
|
|
LinkBack | Outils de la discussion |
|
|
#1 |
|
Messages: n/a
Hébergeur: |
Hi all,
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> Can someone tell me where I'm going wrong? Thank you in advance, Raj (newbie) |
|
|
|
#2 |
|
Messages: n/a
Hébergeur: |
raj wrote:
> Hi all, > > 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> > > Can someone tell me where I'm going wrong? > > Thank you in advance, > > Raj (newbie) > > addslashes() is the wrong function in this case. Look at htmlspecialchars() or htmlentities() -- ================== Remove the "x" from my email address Jerry Stuckle JDS Computer Training Corp. jstucklex@attglobal.net ================== |
|
|
|
#3 |
|
Messages: n/a
Hébergeur: |
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 -- |
|
![]() |
| Outils de la discussion | |
|
|