And where would I Find This File.... ????
: you might also want to check you server config file.. and check that you have "magic quotes" turned off.. with this on it always adds slashes!
:
: : I tried, but it didn't work....
: :
: :
: : : Try using the "stripslashes" function.
: : :
: : : : Hi,
: : : :
: : : : I have created an on-line texteditor wich lets a user alter a page and then save it to the server. The text is first loaded into the document and is placed in a textarea. I then alter the text and finaly want to save it. I use the following code to do so:
: : : :
: : : :
: : : : // Bestanden openen;
: : : : $origineel = false;
: : : : $copy = false;
: : : : $pogingen = 0;
: : : : while ((!$origineel) && ($pogingen < 11)){
: : : : // Origineel Bestand openen
: : : : $origineel = fopen ($BestNaam, "r");
: : : : $pogingen += 1; // Aantal pogingen met 1 ophogen
: : : : }
: : : : $pogingen = 0;
: : : : while ((!$copy) && ($pogingen < 11)){
: : : : // Copy Bestand openen
: : : : $copy = fopen ($BestNaam."_copy", "w");
: : : : $pogingen += 1; // Aantal pogingen met 1 ophogen
: : : : }
: : : : if ($origineel && $copy) {
: : : : // De bestanden zijn beiden open, nu het origineel overnemen tot aan $StartPos;
: : : : $intTeller = 0;
: : : : while($StartPos > $intTeller) {
: : : : $regel = fgets($origineel, 1024);
: : : : fputs($copy,$regel);
: : : : $intTeller++ ;
: : : : }
: : : : // Het eerste ongewijzigde gedeelte is overgenomen, nu het gewijzigde deel overnemen
: : : : // Eerst de \" vervangen door "
: : : : str_replace("\\\"","\"",$editor);
: : : : fputs($copy,$editor);
: : : : // Het gewijzigde gedeelte overslaan in het originele bestand (dus alleen lezen en niets met de info doen...)
: : : : for($intTeller=0;$intTeller < $Blok; $intTeller++) {
: : : : $regel = fgets($origineel,1024);
: : : : }
: : : : // De overgebleven ongewijzigde regels uit het originele bestand overnemen.
: : : : while(!feof($origineel)) {
: : : : $regel = fgets($origineel,1024);
: : : : fputs($copy,$regel);
: : : : }
: : : : }
: : : : $ErrMess1 = fclose($origineel);
: : : : $ErrMess2 = fclose($copy);
: : : : if($ErrMess1 == false || $ErrMess2 == false) {
: : : : echo "Het bestand kon niet worden opgeslagen...\n";
: : : : } else {
: : : : echo "Het bestand is opgeslagen.\n";
: : : : }
: : : : // Het origineel overschrijven met de copy
: : : : unlink($BestNaam);
: : : : rename($BestNaam."_copy",$BestNaam);
: : : :
: : : :
: : : :
: : : : This works allright until a text is loaded that contains " signs. It loads allright, but when it is saved the new textfile does not contain " but \" I tried to filter this out by placing the str_replace function but it didn't help. Does anyone know how to solve this ???
: : : :
: : : :
: : : :
: : : :

: : : : -mac-
: : : : mailto:programmersheaven@mac-doggie.nl
: : : : the Netherlands...
: : : :
: : : :
: : :
: : :
: :
: :

: : -mac-
: : mailto:programmersheaven@mac-doggie.nl
: : the Netherlands...
: :
: :
: :
:
:

-mac-
mailto:programmersheaven@mac-doggie.nl
the Netherlands...