Solved

Quotes

Posted on 2006-10-21
2
266 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 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: IP Lookup

Get more info about an IP address or domain name, such as organization, abuse contacts and geolocation.

One of a set of tools we are providing to everyone 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…
These days socially coordinated efforts have turned into a critical requirement for enterprises.
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 dynamically set the form action using jQuery.

726 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