Reply to Re: [PHP] Problem: Distortion while saving text file.

Your name:

Reply:


Posted by David Grant on 10/21/83 11:34

Could it be the other way around, i.e. Windows is stripping slashes, and
Linux is not? How does $contents come to exist in the script?

Check for any difference in your ini files for magic_quotes_runtime.

Cheers,

David Grant

Janne Miettunen wrote:
> What could be wrong when this is transformed:
> "<img src="graphics/auringonlasku2.jpg" align="left">"
> ....to this form:
> "<img src=\"graphics/auringonlasku2.jpg\" align=\"left\">"
>
> The line is saved to text file with this function:
>
> function savesite($site, $lang, $contents){
>
> if (check_session()){
> $file=fopen('content/' . $site . '_' . $lang . '.txt', "w");
>
> fwrite($file, $contents);
>
> fclose($file);
> }
>
> I run it through nl2br() before saving and this only happens on Linux
> server, on Windows server it works fine, no \ before ".
>
> Tested with:
> On Windows: Apache2, PHP5
> Linux: Debian distro, Apache2, PHP4, also tried with PHP5
>


--
David Grant
http://www.grant.org.uk/

[Back to original 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

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