"slash before every quote" problem

Posted by Camran on Stack Overflow See other posts from Stack Overflow or by Camran
Published on 2010-06-09T13:47:46Z Indexed on 2010/06/09 13:52 UTC
Read the original article Hit count: 173

Filed under:
|
|
|

I have a php page which contains a form.

Sometimes this page is submitted to itself (like when pics are uploaded).

I wouldn't want users to have to fill in every field again and again, so I use this as a value of a text-input inside the form:

value="<?php echo htmlentities(@$_POST['annonsera_headline'],ENT_COMPAT,'UTF-8');?>">

This works, except it adds a "\" sign before every double-quote...

For instance writing 19" wheels gives after page is submitted to itself:

  19\" wheels

And if I don't even use htmlentities then everything after the quotes dissappears.

What is the problem here?

© Stack Overflow or respective owner

Related posts about php

Related posts about mysql