Support » Plugins and Hacks » How to get $_POST data from plugins option page?

  • I’m creating plugin that require to edit/write css to the file.
    here is the code to write to a file.

    $files = $themepath.'/custom/style.css';
    $fp = fopen($files, 'w');
    fwrite($fp, get_option("custom_css"));

    when i use that code, it will write get_option("custom_css") that already saved to the database but not what i recently write to the text area. yes, because its not been saved yet.

    instead of that, i would like to replace with
    fwrite($fp, $_POST['custom_css']);

    but hey, $_POST[‘custom_css’] has no value. print_r($_POST) also return blank. I know it because form action is option.php that is not the current page <form method="post" action="options.php">

    the question is how to get $_POST value from options.php?
    or is there any other smart way to do that?

    thanks for help, sorry for bad english 😀

Viewing 2 replies - 1 through 2 (of 2 total)
  • No replies since. 🙁

    hoho.. anyone?




    generally i have the same issue. How to pass “post” or “get” vars to plugin files to receive them by any kind of custom (“plugin”) script.

    Is there really no developer, moderator or whomever, knowing an adequate answer or at least a hint on this.

    Please help!


    Here is a possible answer for all those having problems with passing get or post vars through query string:

Viewing 2 replies - 1 through 2 (of 2 total)
  • The topic ‘How to get $_POST data from plugins option page?’ is closed to new replies.