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?
UPDATE:
Okay, so the prob is magic_quotes... This is enabled on my server...
Should I disable it? I have root access and it is my server :)
Whats the harm in disabling it?
Looks like you have magic quotes turned on. Use below condition using
stripslashes
with whatever text you want to process:Now you can process
$your_text
variable normally.Update:
Magic quotes are exaplained here. For well written code there is normally no harm in disabling it.