Where are the form values?
Where are the form values?
Allan
I want to use the data typed in the Editor window to set field en another database. I mean, supones you are adding a new person in the table "A". When you accept you add the data in table "A" and at the same time I want to add "same" data in fields of the "B" table.
You suggest to use
if ( isset( $_POST['action'] ) && $_POST['action'] === 'create' ) {
// … insert new row into second table
}
but how can I do the "INSERT" using values in the form??
Thanks a lot
I want to use the data typed in the Editor window to set field en another database. I mean, supones you are adding a new person in the table "A". When you accept you add the data in table "A" and at the same time I want to add "same" data in fields of the "B" table.
You suggest to use
if ( isset( $_POST['action'] ) && $_POST['action'] === 'create' ) {
// … insert new row into second table
}
but how can I do the "INSERT" using values in the form??
Thanks a lot
This discussion has been closed.
Replies
The data is in the `$_POST['data']` associative array, with the parameter names matching the `name` you gave for the Editor initialisation. So for example if you had:
[code]
{
"label": "Browser name",
"name": "browser"
}
[/code]
In the Editor Javascript initialisation, you could do:
[code]
$_POST['data']['browser']
[/code]
to get the value in PHP. The values can then be using to do a regular SQL INSERT.
Allan