Can't insert data from "" using "$_POST" into WP DB using $wpdb->insert
-
To begin, I have a “Dev Environment” setup on my computer. WordPress is running through XAMPP within it’s normal structure and as as far as I can tell everything is running properly.
The problem that I’m running into is that I’m trying to capture information from several form fields hosted on a unique template page. Here’s how the page is setup:
Pastebin: code url!
[Code moderated as per the Forum Rules. Please use the pastebin]
The information from this form is captured and sent via the post method. The PHP page that suppose to collect this information collect.php captures each post within a unique variable through the $_POST method. Here’s sort of what that page looks like.
Pastebin: Code url!
[Code moderated as per the Forum Rules. Please use the pastebin]
This is the page that is see after the submission of the form forwards me to collect.php:
Echoed output through captured POST
Fname: FirstName
Lname: Lastname
email: [email protected]
work_phone: 1231231234
cell_phone: 1231231234
url: http://www.url.com
add_info: Additional InfoEnd of output!
Notice: Trying to get property of non-object in …\collect.php on line 29
Fatal error: Call to a member function insert() on a non-object in …\collect.php on line 33
Now here’s the problem: I seem to be capturing and storing the data/info within the variables just fine. It’s just that when I try and insert this data/info into the wp_subject_info table within the WordPress database it doesn’t work. I can’t figure it out! I understand that the solution is most likely insanely simple but I can’t find a plausible solution anywhere. If anybody could help it would be greatly appreciated. Thanks in advance.
The topic ‘Can't insert data from "" using "$_POST" into WP DB using $wpdb->insert’ is closed to new replies.