I have a development machine that is local and a server out on the net. Weird thing is that when I use stripslashes on my development machine, all slashes are removed and when I upload the same code to the net server, I see the escape character even though I am using stripslashes. Anyone have any ideas?
...
I'm having issues escaping/stripping strings with PHP/MySQL - there always seems to be redundant slashes.
Let's take the following string as an example:
<span style="text-decoration:underline;">underline</span>
When adding a string to the database, I'm escaping it with mysql_real_escape_string() and the following gets stored in th...
Hi,
(Php & MySQL)
I'm trying to figure out how come this function does not work correctly.
It's add extra \ everytime I edit my entries.
Online server have these settings:
magic_quotes_gpc On
magic_quotes_runtime Off
magic_quotes_sybase Off
function esc($s)
{
if (get_magic_quotes_gpc()) {
if (ini_get('magic_quotes_sy...
I'm building a custom options panel in Wordpress. One of the options I'd like to offer is the ability to add text and html to the footer. I can enter simple tags like, bold - but when you add a URL crazy stuff happens. I did some googling and found "stripslashes", alas that doesn't work either.
The code below is part of a giant case sta...
I've seen dozens of PHP snippets that go like this:
function DB_Quote($string)
{
if (get_magic_quotes_gpc() == true)
{
$string = stripslashes($string);
}
return mysql_real_escape_string($string);
}
What happens if I call DB_Quote("the (\) character is cool");? (Thanks jspcal!)
Aren't we supposed to strip slas...
Problem when I enter any input which has underscore (_) data will store to my db looks like this image\_background.png
Example
$image = stripslashes($_POST['image']); // example image name image_background.png
$query = 'UPDATE product SET image="'. $db->string_escape($image, true).'" WHERE id="'. intval($id).'"';
The problem coming ...
My xml feed file is using stripslashes, but I also want to remove special characters from som fields - how would I do that and where/what order would I add it?
$output .= "<address>".htmlentities(html_entity_decode(stripslashes($row->street_num)))." ".htmlentities(html_entity_decode(stripslashes($row->address2)))."</address>\n";
...
I have an odd one - I am porting some data from one CMS to another. Both run on LAMP.
In the old CMS, the data was stored, with slashes in the DB.
Examples:
Hi. Thanks for looking. It\'s \"awesome\".
That correctly displays when output by the old CMS as:
Hi. Thanks for looking. It's "awesome".
But in the new CMS, they same text i...
So, when I save the data into database, PHP will add a \ on single or double quote. That's is good.
However, when data passing back to client using json_encode(); TEXT like McDonald's is STORED as McDonald's in DB but once pass back from PHP to js, it will be encoded as McDonald\'s
Since I'm using jQuery, is there any plugin easily ...