Jump to content

Recommended Posts

I am trying to print data from a database into a form. I used  the mysql_escape_string() function before the data was inserted so slashes were added before all quotes. The problem is that when I try to print the data and use stripslashes() to remove the slashes the output stops before the single quote (').

 

 

It is supposed to output "Billy Ray's.."

 

The code that outputs the text:

<input type='text' name='name' id='name' value='<?php echo stripslashes($fields['name']['value']); ?>' />

 

Image of output

field.jpg

 

What I find odd is that the html source from the webpage shows the full string:

<label>Name of Bar: <span class='required'>*</span></label> 
<input type='text' name='name' id='name' value='Billy Ray's...' /> 

 

Does anyone have any idea what is going on?

 

 

 

Link to comment
https://forums.phpfreaks.com/topic/191182-problem-printing-data-from-database/
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.