Jump to content

Quotes Issue


dfowler

Recommended Posts

Hey guys, I have an annoying little quotes issue.  I'm hoping somebody here can help me out.  I have created a form that inserts values into a database.  I use addslashes() for all the $_POST variables, and everything adds perfectly!  (ie O'Malley, Wendy's, etc..)

 

I have also created an edit page that displays these values in an <input> so they can be edited.  Here is where my problem is.  The values are stopping where the single quote is (ie O, Wendy, etc...).  However, if I just echo the variables they show perfectly.  What am I missing?

Link to comment
Share on other sites

I am sure this same problem was just posted and solved within the past few days.

 

Actual quotes that are output to the browser are operated on and rendered. So, a quote can/will break a value="..." parameter in a form field.

 

To output special characters that a browser would operate on as literal characters, use the htmlentities() function with ENT_QUOTES as the second parameter.

Link to comment
Share on other sites

I am sure this same problem was just posted and solved within the past few days.

 

Actual quotes that are output to the browser are operated on and rendered. So, a quote can/will break a value="..." parameter in a form field.

 

To output special characters that a browser would operate on as literal characters, use the htmlentities() function with ENT_QUOTES as the second parameter.

Thanks, I tried searching for quotes but couldn't find any answers.  This solved it perfectly!

Link to comment
Share on other sites

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.