Data not posting to contact form DB

I am trying to send data to the Contact Form DB I have for my WordPress site. The following code doesn’t give any error but it doesn’t post any values. When I check the DB, although the data is getting sent, and I see an empty row of values, but the values are invisible for some reason. I am not to figure out the issue. Thanks

[php]

$data = (Object) array(
‘title’ => ‘Test Form’,
‘posted_data’ => array(
‘First Name’=> $_POST[‘test’],
‘Last Name’ => $_POST[‘test’],
‘Phone’ => $_POST[‘4892892932’],
'City ’ => $_POST[‘Seattle’])
);

//$d = var_export($data);
// $d = (string)$data;
// echo $d;

require_once(ABSPATH . ‘wp-content/plugins/contact-form-7-to-database-extension/CF7DBPlugin.php’);
do_action_ref_array( ‘cfdb_submit’, array(&$data));
[/php]

Need the code. Values aren’t invisible in a database, they are either there or they are not.

Wordpress is a hellish but, sometimes useful thing. It also creates its very own headaches.

[member=72272]astonecipher[/member] Yeah when I did output $data, post is returning null values. What do you mean by whole code? this is the code.

So, what you posted is in regards to a dump, not the actual code used???

This,

[php] $data = (Object) array(
‘title’ => ‘Test Form’,
‘posted_data’ => array(
‘First Name’=> $_POST[‘test’],
‘Last Name’ => $_POST[‘test’],
‘Phone’ => $_POST[‘4892892932’],
'City ’ => $_POST[‘Seattle’])
);[/php]

Wont output anything anyway.

print_r( $_POST ) should however.

[member=72272]astonecipher[/member] I tried the print_r, and the output is a boolean saying true, and I then posted the value so it is inserting 1’s in each variable in the database. How do I convert the bool to the actual content?

What is the actual form code.

$_POST takes the names of the input’s and holds the values that are passed in. And I don’t think that your inputs are named,
test , test, 892892932 ,Seattle; at least I hope not.

You are right… the inputs are named ‘First Name’ , ‘Last Name’ etc…

So then, how or where do I pass the values to these?

And you form method is post?

That means that the values are accessible using $_POST[‘First Name’], $_POST[‘Last Name’]

It is contact form 7, but I am trying to insert the data into the contact form DB. I think the method is definitely $_POST

Have you looked at this yet, http://wptips.me/contact-form-7-save-submited-data-in-the-database/

I did, not sure how to implement it at all. The web developer has used plugins for everything, it is not a sql table or DB.

[member=72272]astonecipher[/member] Now, it is actually inserting the value but not the way I want it. For example, if I am inserting anything under ‘First Name’, the code is creating a new column with value test instead of putting it under ‘First Name’

In the plug in directory, it will have a SQL insert statement. Need to figure out what that is doing. The plug-in doesn’t sound too well created if it is dynamically creating columns in the first place.

Sponsor our Newsletter | Privacy Policy | Terms of Service