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

  1. Da9L
    Posted 2 years ago #


    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 !


  2. Da9L
    Posted 2 years ago #

    So this supposedly simple thing is not possible in WordPress ?

Topic Closed

This topic has been closed to new replies.

About this Topic