Solved

Quotes

Posted on 2006-10-21
2
261 Views
Last Modified: 2008-03-06
I'm trying to edit one php page with another. However, when I try to write the php page back to file. All of the quote marks are slashed out. How do I stop this from happening? It's extremely annoying...
0
Comment
Question by:Exceter
2 Comments
 
LVL 6

Accepted Solution

by:
Kosta earned 250 total points
Comment Utility
Quotes are slashed in strings that come to the script from user (POST, GET or COOKIE). There are several ways to solve this.
1. If this is your server and you can edit php.ini file, than you should just change this setting in your php.ini:
magic_quotes_gpc = Off
But, be carefull than, if you work also with database, and insert/update/select user data (POST, GET or COOKIE) into/from database, you should take care of quotes by yourself, using addslashes() or using mysqli library instead of mysql.

2. You can remove slashes from strings using stripslashes() function in your code.
0
 
LVL 8

Author Comment

by:Exceter
Comment Utility
Thanks!
0

Featured Post

6 Surprising Benefits of Threat Intelligence

All sorts of threat intelligence is available on the web. Intelligence you can learn from, and use to anticipate and prepare for future attacks.

Join & Write a Comment

Suggested Solutions

Introduction Many web sites contain image galleries; a common design for these galleries includes a page with a collection of thumbnail images.  You can click on each of the thumbnail images to see the larger version of the image.  This is easily i…
Author Note: Since this E-E article was originally written, years ago, formal testing has come into common use in the world of PHP.  PHPUnit (http://en.wikipedia.org/wiki/PHPUnit) and similar technologies have enjoyed wide adoption, making it possib…
Learn how to match and substitute tagged data using PHP regular expressions. Demonstrated on Windows 7, but also applies to other operating systems. Demonstrated technique applies to PHP (all versions) and Firefox, but very similar techniques will w…
Explain concepts important to validation of email addresses with regular expressions. Applies to most languages/tools that uses regular expressions. Consider email address RFCs: Look at HTML5 form input element (with type=email) regex pattern: T…

762 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

7 Experts available now in Live!

Get 1:1 Help Now