fputs() unwanted backslashed

Ask about general coding issues or problems here.

Moderators: macek, egami, gesf

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

Re: fputs() unwanted backslashed

Post by WiZARD » 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!

Post Reply

Who is online

Users browsing this forum: No registered users and 9 guests