You are here: Re: Reading from file « All PHP « IT news, forums, messages
Re: Reading from file

Posted by Murfy on 02/05/06 03:55

Dalibor schreef:
> I have following code for putting contenst of a file into a web page:
> <?php
> $filename = "../msd/news.txt";
> $handle = fopen ($filename, "r");
> $content = fread ($handle, filesize($filename));
> fclose($handle);
> echo ($content);
> ?>
> But in file news.txt I have formating that is not showing, but
> interpreting.
> For example, in that file there is:
> <a href="link.php">link</a>
> End result is hyperlink.
>
> Can you tell me what I did wrong?
> --
> .:Dalibor:.

Just echo htmlentities($content); and you'll be fine :D

 

Navigation:

[Reply to this message]


Удаленная работа для программистов  •  Как заработать на Google AdSense  •  England, UK  •  статьи на английском  •  PHP MySQL CMS Apache Oscommerce  •  Online Business Knowledge Base  •  DVD MP3 AVI MP4 players codecs conversion help
Home  •  Search  •  Site Map  •  Set as Homepage  •  Add to Favourites

Copyright © 2005-2006 Powered by Custom PHP Programming

Сайт изготовлен в Студии Валентина Петручека
изготовление и поддержка веб-сайтов, разработка программного обеспечения, поисковая оптимизация