|
Posted by sTony on 11/05/06 15:08
"AlexVN" <alexander.netkachev@gmail.com> wrote in message
news:1162631571.104837.73240@f16g2000cwb.googlegroups.com...
>
>
> On Nov 4, 3:33 am, "sTony" <rWorldDesi...@yahoo.ca> wrote:
> > I'm a bit of a php newbie (understatement) and I'm writing a website
that
> > allows users to edit the pages of the website, like wikipedia does.
Anyhow,
> > I'm stuck.
> >
> > I can edit just fine.. I just htmlspecialchars the contents of a page
into a
> > <textarea> tag within a form, and then the user can edit the page in the
> > text area, but my version of php doesn't support
htmlspecialchars_decode, so
> > I'm having trouble saving the page properly. Other than upgrading my
php
> > version, (it took me forever to get it working) does anyone have any
ideas
> > that could help me?
> >
> > Thanks in advance,
> >
> > sTony
>
> htmlspecialchars just replaces some characters with corresponding HTML
> entities. You can easy create a mirror function, which replaces them
> back into characters with the http://www.php.net/str_replace function.
>
> Sincerely,
> Alexander
> http://www.alexatnet.com/ - PHP/ZendFramework/Ajax blog
>
Thanks alex, I wrote a decode function and made my own encode function as
well, but I was actually mistaken about my problem. It seems that I had
inadvertantly run my data through my clean() function, which I use to make
sure that userdata data doesn't contain code. Since I wanted code in this
particular user data, things weren't working. I've got everything fixed up
now though, almost.
I'm getting mysterious backslashes in my post data when I send the contents
of my textarea. It seems that somewhere, somehow, the data from the textarea
gets its quotes escaped. I'm not doing anything to it either.. I just POST
it, and then when I read it, all quotes are escaped. If you or anyone else
has any idea why this could be happening, I'd love to know. If not, I'll
write a hack for it in the morning, but I'd really hate to do that without
knowing why its happening. Does anyone know where these mysterious
backslashes are coming from?
[Back to original message]
|