Eseye Eseye - 1 year ago 70
PHP Question

Send $_POST data to custom Wordpress plugin

I have a custom Wordpress plugin that handles many things including download pages for my products. The links are not the path to the actual PHP page to my plugin. For example...

But the path to my plugin that actually handles the download function is this path:

I have built an app that uses these download links to grant a user the ability to download a product after purchase. But now I need to send extra data along with the url. How can I send some additional $_POST data when the users click on the download link. I have tried

But when I try to echo out the variables in myplugin.php I get nothing.

echo $_GET['id'];

echo $_GET['user'];

I have also tried to use a form and send hidden inputs but still the same result.

Any help would be greatly appreciated.

Answer Source

Create a new shortcode (maybe empty that does nothing) and put it on some page you created from WordPress. Then, form action will be the URL to new page where you send data you need to send and method will be post. You can handle the data you sent in new shortcode function in your plugin using $_POST['data']

This might help you as an alternative solution.

Recommended from our users: Dynamic Network Monitoring from WhatsUp Gold from IPSwitch. Free Download