Still celebrating National IT Professionals Day with 3 months of free Premium Membership. Use Code ITDAY17

x
?
Solved

Quotes

Posted on 2006-10-21
2
Medium Priority
?
271 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
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
2 Comments
 
LVL 6

Accepted Solution

by:
Kosta earned 1000 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

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…
Part of the Global Positioning System A geocode (https://developers.google.com/maps/documentation/geocoding/) is the major subset of a GPS coordinate (http://en.wikipedia.org/wiki/Global_Positioning_System), the other parts being the altitude and t…
This tutorial will teach you the core code needed to finalize the addition of a watermark to your image. The viewer will use a small PHP class to learn and create a watermark.
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 …

715 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