Code2care : TechZone Apps & Tutorials

Forward Slash added before single or double quotes (PHP) Hosting

Forward Slash added before single or double quotes (Hosting)

To get rid off the forward Slashes (/) included before every single (') or double quote(") in PHP hosting. Edit the php.ini file and add the following line,

magic_quotes_gpc = Off;

If PHP your code works fine on a Windows does not guarantee that it will also work on Linux or vice-versa. There are loads of issues that may come up when deploying your PHP code on Linux environment, such as case-sensitivity issues and single quotes, double quotes, slash issues etc. These issues can be resolved using the php configuration file i.e. php.ini file.

About PHP Magic Quotes

PHP magic quotes when ON all the single quotes (') , double quotes ("), backslashes (\) and NULL characters are escaped with a backslash Automatically

PHP Magic quotes directives :

magic_quotes_gpc :If ON it affects HTTP GET, POST and COOKIE Request data.

magic_quotes_runtime : Though by default its OFF but when this directive is ON, most functions that return data from an external source, including databases and text files, will have quotes escaped with a backslash. This can be set at runtime.

magic_quotes_sybase : If this directive is ON, a single-quote is escaped with a single-quote instead of a backslash.

Note : Magic Quotes have been DEPRECATED as of PHP 5.3.0 and REMOVED as of PHP 5.4.0.


Posts related to php.

1. Forward Slash added before single or double quotes (PHP) Hosting

2. PHP Script to Upload Images to Server

3. PHP ver 5.4.37 Released

4. How to destroy PHP session()

5. Top 15 Programming Languages to learn 2014-2015

6. Upload docx file using PHP script

7. Connection Failed: 1130 PHP MySQL Error

8. PHP header location function not called(Solved)

Code2care : Lines of Code for Change
Code2care is an initiative to publish and share varied knowledge in technical and non-technical areas gathered during day-to-day learnings and development activities.

Android app on Google Play    

Popular tags
x 175
x 29
x 20
x 14
x 14
x 14
x 13
x 11

1000+ C Programs     PHP Tutorial     JSON Tutorial     Swift Tutorial     India Pinocdes     About Us     Privacy Policy

Code2care © 2012-17