WordPress.org

Ready to get started?Download WordPress

Forums

From data not submitting between pages in admin area (2 posts)

  1. Da9L
    Member
    Posted 10 months ago #

    Hey

    I've been struggling to find out why i cant send some data between pages. Actually it is the same page im sending data to, but it just wont work for some reason, its like WP is filtering out what im trying to do..

    Im using POST to do it, and its on an Admin page in a plugin.

    Heres my form:

    $html .= '<form method="POST" action="#" name="formdiscount" enctype="multipart/form-data">';
                        $html .= '<input type="hidden" value"hallo" name="discount">';
                        $html .= '<input type="hidden" value="'.$url.'" name="formurl">';
                        $html .= '<input type="hidden" value="'.$img_id.'" name="formid">';
                        $html .= '<input type="submit" value="Slet billede Test" name="jahallo">';
                        $html .= '</form>';

    As you can see the form is written to a variable called $html which is later echo'ed.. That works, the form is being shown and pressing the submit button, does send the user to the same page

    I then earlier have this simple piece of code to verify that the data has been sent

    if(isset($_POST['formurl'])) {
            echo 'Det virker!';
        }

    But nothing is echo'ed out .. What am i doing wrong?! Do i need to add my form to some sort of whitelist ?

    Thanks !

    ~D

  2. Da9L
    Member
    Posted 10 months ago #

    So this supposedly simple thing is not possible in WordPress ?

Reply

You must log in to post.

About this Topic