Jump to content

[SOLVED] fwrite Question


Sleeper

Recommended Posts

I have a form where I can input html coding that will be saved to a txt file and then pulled by the website to displate the code entered. I have the form going to a page with the following code.

 

<code>

<?php

$wfto=$_POST['wfto'];

 

$file_name = "data/wfto-d2.txt";

$fp = fopen($file_name, "w");

//write to the file

fwrite ($fp, "$wfto\n");

fclose($fp);

?>

</code>

 

My only issue is when it saves the coding all the " end up with \" then when the file is opened up the form text area loads this info and when resaved it will end up like \\\" this obviusly wont work well. So my question is how do I get the post data to write to the text file exactly as entered and not modified so when loaded it looks exactly as it was inputed?

Link to comment
https://forums.phpfreaks.com/topic/116759-solved-fwrite-question/
Share on other sites

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.