php - Why mysql is not storing data after "#" character? -
i have made 1 form in there rich text editor. , m trying store data database.
have 2 problem..
1) string contents "#"(basically when try change color of font) character, not store characters after "#". , not store "#" character also.
2) although had tried....in javascript
html.replace("\"","'");
but not replace double quotes single quotes.
we'll need see code. feeling you're missing essential escaping step somewhere. in particular:
as string contents "#"(basically when try change color of font) character
implies me might sticking strings url this:
var url= '/something.php?content='+html;
naturally if html
contains #
symbol, you've got problems, because in:
http://www.example.com/something.php?content=<div style="color:#123456">
the #
begins fragment identifier called #123456">
, when put #section
on end of url go anchor called section
in html file. fragment identifiers purely client-side , not sent server, see:
http://www.example.com/something.php?content=<div style="color:
however far problem above. space, <
, =
simly invalid in urls, , other characters &
mess parameter parsing. encode arbitrary string query parameter must use encodeuricomponent
:
var url= '/something.php?content='+encodeuricomponent(html);
which replace #
%35
, other out-of-band characters.
however if indeed you're doing, should in case should not storing database in response request, nor relying on pass potentially-large content. use post request instead.
Comments
Post a Comment