WordPress.org

Ready to get started?Download WordPress

Forums

How to get $_POST data from plugins option page? (3 posts)

  1. takien
    Member
    Posted 4 years ago #

    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"));
    fclose($fp);

    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 :D

  2. takien
    Member
    Posted 4 years ago #

    No replies since. :(

    hoho.. anyone?

  3. orbitkiller
    Member
    Posted 4 years ago #

    Hi,

    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!

    @Edit:

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

    http://wordpress.org/support/topic/273357?replies=3

Topic Closed

This topic has been closed to new replies.

About this Topic

Tags