Jump to content

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.

 

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • 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.