Re: problem in writing into an html text file

From: Date: Thu, 27 Feb 2003 03:35:58 +0000
Subject: Re: problem in writing into an html text file
References: 1 2  Groups: php.general 
Request: Send a blank email to php-general+get-137351@lists.php.net to get a copy of this message
sorry here's the sample code: <? if(!$submit){ ?> <form> <? $filename="my.html"; $fd=fopen($filename,"r+") or die("Can't open file $filename"); $message = fread($fd, filesize($filename)); fclose($fd); ?> <textarea name="message" cols="95" rows="20"><? echo $message;?>/textarea> <input type="submit" name="submit" value="modify"> </form> <? }else{ $filename="my.html"; $fd=fopen($filename,"w") or die("Can't open file $filename"); $fstring=$message; $fout = fwrite($fd, $fstring); fclose($fd); } ?> the html file upon modify multiplies all the backslashes. any idea why? thanks in advance. ----- Original Message ----- From: "Jason Sheets" <jsheets@php.net> To: "Michael P. Carel" <mikecarel@teamglac.com> Cc: <php-general@lists.php.net> Sent: Thursday, February 27, 2003 12:04 PM Subject: Re: [PHP] problem in writing into an html text file > Hello Mike, > > You will need to better describe your problem and preferably show some > source code. > > What characters are being added to it? You could use str_replace or the > regular expression replacement functions but you should not get added > characters in general. > > Jason > On Wed, 2003-02-26 at 19:07, Michael P. Carel wrote: > > hi to all, > > > > Im having a problem writing an HTML code in a text file which comes from the > > html text area as an editor. There's an added characters inserted to it. How > > could i write to it perfectly? > > > > mike > > > > > > -- > > PHP General Mailing List (http://www.php.net/) > > To unsubscribe, visit: http://www.php.net/unsub.php > > > -- > PHP General Mailing List (http://www.php.net/) > To unsubscribe, visit: http://www.php.net/unsub.php

« previous php.general (#137351) next »