0

I would like to log every submission of a web form made on our website from the $_POST array, and save it to our mysql database.

I'm outputting the following to the submission page which is obviously very readable:

print "<pre>";
print_r($_POST);
print "</pre>";

Looks like:

Array
(
    [field1] => value1
    [field2] => value2
    [field3] => value3
)

Is it possible to save it exactly like that but to a text field?

And then what about pulling that information back out of the table and converting it back to an array for processing?

James Wilson
  • 809
  • 3
  • 14
  • 25

1 Answers1

1

use json_encode($_POST,true); and store in text field and after fetching the field use json_decode($variable,true); decode into array.

JYoThI
  • 11,977
  • 1
  • 11
  • 26