php - trying to input special charaters into database using text editor -
i've searched on here , can not find right answer, might asking much. have form (that upload admin) update users description , include special characters etc see below. php code when updating database.
$conn = getconnection(); $conn->osc_dbexec(sprintf("update %st_editable set s_heading = '%s' content_id = '%d'", db_table_prefix, $s_heading,$id)); $conn->osc_dbexec(sprintf("update %st_editable set s_message = '%s' content_id = '%d'", db_table_prefix, $s_message,$id)); $conn->osc_dbexec(sprintf("update %st_editable set resume = '%s' content_id = '%d'", db_table_prefix,($resume),$id));
wont bother guys rest of code because dealing peoples if statements work fine. form use simple text editor ,
<tr> <td valign=top>description:</td> <td><textarea cols=45 rows=6 name=resume><?php echo $detail['resume']; ?><?=$a1[resume]?></textarea></td>
my question if type description, need go database can output exactly. eg
<strong>your details</strong> <p>this stuff, <i>account</i> <ul><li><strong>test one</li></ul></p>
any ideas how use update function database.?
depending on way inputing data, wrap links in anchor tags , store them way...
so example if
$link = "users link";
simply
$input_string = "<a href=\"$link\"" . $link . "</a>";
if of users input link use preg_match first identify if user input link. modify above before entering database.
alternatively store link string (i.e. in case $link) in database , when outputing add anchor tags above.
Comments
Post a Comment