Jump to content

[SOLVED] fwrite() quotation marks escaping.


lszanto

Recommended Posts

I've been using fwrite a fair bit to edit a stylesheet but for some reason everytime I put in a single quotation like ' or normal quotation marks like " it comments them out when I open the file stuffing everything up e.g " will become \" does anybody know how to fix this?

Link to comment
https://forums.phpfreaks.com/topic/50777-solved-fwrite-quotation-marks-escaping/
Share on other sites

Ok here is my code.

					//Get vars.
				$style = $_POST['style'];

				//Open file for writing.
				$fh = fopen($path . "text.css", "w");

				//Write data.
				$write = fwrite($fh, $style);

				//Check if works.
				if($write) {
					//Close file.
					fclose($fh);

					//Echo results.
					echo "<p>\n\nYour styles have been updated, please click <a href=\"view_news.php\" target=\"_blank\" >here</a> to see the changes.";
				}

 

I'll check the stripslashes() function now.

Thanx for the credit, but just joking.

 

As far as hard work, if you need a certain function and you do not know about it, you might as well bang your head against the wall.

 

It took me a few years before I found it by accident.

That why we get paid big bucks for little work. :)

That is when we on the clock, not here.

 

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.