I have a form with over 100 dynamically named fields, that post to a php file, I want to take all the fields that are posted to the php file which is currently:
Array ( [option_page] => plugin_options
[action] => update
[_wpnonce] => a51bfc281a
[_wp_http_referer] =>/wp-admin/options-general.php page=plug.php
[13939069] =>
[2171] =>
[3600645] =>
[2168] =>
[13937024] =>
[submit] => Save Changes
[__qca] => P0-1887521465-1334258158937
[s_vi] => )
From this I want to insert the data into a mysql table in the format:
id | option_name | value
--------------------------------------------
autonum | post data key | post data value
But the issue is I am only intrested in the post data value after: [_wp_http_referer]
but before [submit] so these can be used as reference points.
The part I am stuggling with is:
- how would I get only that part of the post data dynamically?
- How would I get the required array keys and insert it into the
table dynamically?
Many thanks!
You mat try this