Getting post data in plugin
-
Ive been messing around with making plugins, but I’m not primarily a php programmer. I’m trying to get the form data from the plugin-editor.php page in the plugin itself:
add_action('init', 'one');
add_action('admin_head', 'two');$formField = "";
function one()
{
global $formField;
$formField .= $_POST['file'];
//echo "one:" . $formField;
}function two()
{
global $formField;
echo "two:". $formField;
}If I echo out the $formField variable in the first function (init) then it has the correct field value. But How can I then assign that value to a variable that is accessible when I get to the second function (admin_head).
If I do echo $_POST[‘file’] in the admin_head it returns no value.
Thanks,
nmoog
The topic ‘Getting post data in plugin’ is closed to new replies.