Solved

Quotes

Posted on 2006-10-21
2
265 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
ID: 17782438
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
ID: 17782441
Thanks!
0

Featured Post

Free Tool: Path Explorer

An intuitive utility to help find the CSS path to UI elements on a webpage. These paths are used frequently in a variety of front-end development and QA automation tasks.

One of a set of tools we're offering as a way of saying thank you for being a part of the community.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Foreword (July, 2015) Since I first wrote this article, years ago, a great many more people have begun using the internet.  They are coming online from every part of the globe, learning, reading, shopping and spending money at an ever-increasing ra…
Developers of all skill levels should learn to use current best practices when developing websites. However many developers, new and old, fall into the trap of using deprecated features because this is what so many tutorials and books tell them to u…
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…
The viewer will learn how to create a basic form using some HTML5 and PHP for later processing. Set up your basic HTML file. Open your form tag and set the method and action attributes.: (CODE) Set up your first few inputs one for the name and …

856 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