Solved

Quotes

Posted on 2006-10-21
2
267 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

Technology Partners: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Question has a verified solution.

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

This article discusses four methods for overlaying images in a container on a web page
Many old projects have bad code, but the budget doesn't exist to rewrite the codebase. You can update this code to be safer by introducing contemporary input validation, sanitation, and safer database queries.
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…
The viewer will learn how to count occurrences of each item in an array.

734 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