stripslashes ,get_option not working

why this code not working in new version of wordpress?

update_option('header_ads',$_POST[header_ads]);    
<textarea name="header_ads" dir="ltr"><?=stripslashes(get_option('header_ads')) ?></textarea>

this code display textbox but textbox is not empty and when typing text into that and post Does not change .

Read More

It happened after the update WordPress to the latest version

Related posts

Leave a Reply

1 comment

  1. 3 things:

    1: short tags (short_open_tag) are not enabled in php.ini

    2: you’re running an ancient (<5.4.0) version of php, thus you need short_open_tag enabled in php.ini for <?= to work (see the changelog here http://php.net/manual/en/language.basic-syntax.phptags.php )

    3: your escape method is all wrong, stripslashes is NOT how you’re supposed to escape html. see htmlspecialchars(), and make note of the flags ENT_QUOTES | ENT_SUBSTITUTE | ENT_DISALLOWED