Hi All,
I am trying to add special characters into database using javascript encodeURIComponent.Its working at localhost But in server when adding ' an extra / coming in front of ' how can i remove this problem ,some one help me please

Thanks in advance.

Hi

try to use addslashes as shown below

<?php
$str = "Who's Kai Jim?";
echo $str . " This is not safe in a database query.<br />";
echo addslashes($str) . " This is safe in a database query.";
?>
Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.