php - Single Quotes not parsing -


i have simple form textarea when submitted updates rows in database! want user able enter single quotes reason not getting parsed! have parsing file..

<?php $sql = "select * testimonials id='$pid'";         $pid = $_post['pid'];       $testtitle = htmlentities($_post['ts_tt']);       $testbody = htmlentities($_post['ts_tb']);       $compowner = htmlentities($_post['ts_co']);       $ownertitle = htmlentities($_post['ts_ot']);       $compname = htmlentities($_post['ts_cn']);       $compwebsite = htmlentities($_post['ts_cw']);        include_once "../php_includes/db_conx.php";        $sql = "update testimonials set testtitle='$testtitle', testbody='$testbody', compowner='$compowner', ownertitle='$ownertitle', compname='$compname', compwebsite='$compwebsite' id='$pid'";        if (!mysql_query($sql, $connection)){           die('error: ' . mysql_error());   }   echo 'testimonial has been edited successfully. <br /><br /><a href="admin/">click here</a>';   exit(); ?> 

any ideas all! many - phillip

use

addslashes 

available in php. escapes special characters.


Comments

Popular posts from this blog

basic authentication with http post params android -

vb.net - Virtual Keyboard commands -

c++ - End of file on pipe magic during open -