fputs() unwanted backslashed

Ask about general coding issues or problems here.

Moderators: egami, macek, gesf

Post Reply
User avatar
WiZARD
Moderator
Moderator
Posts: 1240
Joined: Thu Jun 20, 2002 10:14 pm
Location: Ukraine, Crimea, Simferopol
Contact:

Mon Nov 11, 2002 5:36 am

louisb wrote:I am having a small problem while updating a text file, using fputs();
Any quotes or double quotes within the $main variable (which is written to the file) have a preceding backslash added to them.

The $main variable has been passed from a form textarea.

Does any have any idea why this is or what I have done wrong.

if (isset($main)){
if($mainfile=fopen("../../content/main.txt","w")){
fputs($mainfile,$main);
fclose($mainfile);
}else{
echo("Could not open file for writing!");
}
}

Thanks,

LouisB

What is OS you use?
It's very important!
"Sex,Drugs and Rock&Roll " replaced at "Sucks,Bugs and Plug&Play";
Image

Post Reply
  • Information
  • Who is online

    Users browsing this forum: hyper and 7 guests