Help w/ ENT_NOQUOTES - Not Displaying Properly

Links for php scripts

Moderators: macek, egami, gesf

User avatar
sixty7ss
New php-forum User
New php-forum User
Posts: 3
Joined: Mon Apr 09, 2012 9:16 am
Location: Gilbert, Phoenix AZ, United States

Help w/ ENT_NOQUOTES - Not Displaying Properly

Postby sixty7ss » Mon Apr 09, 2012 11:07 am

I'm trying to get an email form to output properly and I'm having an issue with a few of the fields. I added htmlspecialchars() to some of the values and, for the most part, that works great. The problem I'm running into is that I want some of the fields to display the double-quotes. I added the ENT_NOQUOTES flag to the respective fields, but rather than displaying it the way one would expect it to, it adds the backslash character before each one. Here is an example:

Detailed Vehicle Info:
Gear Ratio: 4.10 : 1
Rear Tire Size: 225 / 45 R19
Exhaust: BBK 1-5/8\" Long Tube Headers
Catalytic Converters: None (Off-road Mid-pipe)
Intake Manifold: OEM
Cold Air Intake: JLT CAI2-FMC-0509-P
Camshafts: OEM
Fuel Injectors: ROUSH \"Something\" w/ \"quotes\"
Fuel Pump: OEM
MAF Sensor: SCT SB3000 \"test\"
Torque Converter: OEM
Throttle Body: OEM


Is there any way to remove the \ characters? I'll admit that I'm new to PHP. I would appreciate any advice. Thanks, in advance.

User avatar
egami
php-forum GURU
php-forum GURU
Posts: 2196
Joined: Wed Oct 06, 2010 11:19 am
Location: Happy Valley, UT

Re: Help w/ ENT_NOQUOTES - Not Displaying Properly

Postby egami » Tue Apr 10, 2012 4:44 am

67 Super Sport,
Are you submitting this form via GET or POST?

It *shouldn't* matter at all to be blunt with you, but what it sounds like is that you have magic quotes turned on, on the server.

I recommend turning that off.. as it is nothing but a problem.

php.net/gpc_magic_quotes


To have quotes in a string, you simply need to wrap them in single ticks..

ie..

$myTextString = 'This is my "Happy" Place!';


Return to “PHP Scripts”

Who is online

Users browsing this forum: No registered users and 1 guest

cron