Title: wpwcm's Replies | WordPress.org

---

# wpwcm

  [  ](https://wordpress.org/support/users/wpwcm/)

 *   [Profile](https://wordpress.org/support/users/wpwcm/)
 *   [Topics Started](https://wordpress.org/support/users/wpwcm/topics/)
 *   [Replies Created](https://wordpress.org/support/users/wpwcm/replies/)
 *   [Reviews Written](https://wordpress.org/support/users/wpwcm/reviews/)
 *   [Topics Replied To](https://wordpress.org/support/users/wpwcm/replied-to/)
 *   [Engagements](https://wordpress.org/support/users/wpwcm/engagements/)
 *   [Favorites](https://wordpress.org/support/users/wpwcm/favorites/)

 Search replies:

## Forum Replies Created

Viewing 8 replies - 1 through 8 (of 8 total)

 *   Forum: [Plugins](https://wordpress.org/support/forum/plugins-and-hacks/)
    In
   reply to: [[Contact Form DB] not saving anymore](https://wordpress.org/support/topic/not-saving-anymore/)
 *  Thread Starter [wpwcm](https://wordpress.org/support/users/wpwcm/)
 * (@wpwcm)
 * [11 years, 8 months ago](https://wordpress.org/support/topic/not-saving-anymore/#post-5267395)
 * ok. I found the issue; and hopefully, it could help somebody else.
 * At the beginning of my script, i have 2 different “add_filter” with 2 functions.
   
   1st one is used to check values. 2nd one is used to send an email with the values.
 * I’m quite sure I had only 1 return $formData; at the end of the 1st add_filter
   and before, it was saving the data.
    Now, if i want the data to be saved, I have
   to add the “return $formData;” at the end of the 2nd function too and not only
   at the end of the 1st function (even if the second function is not necessary).
 * does it make sense ?
 *   Forum: [Plugins](https://wordpress.org/support/forum/plugins-and-hacks/)
    In
   reply to: [[Contact Form DB] not saving anymore](https://wordpress.org/support/topic/not-saving-anymore/)
 *  Thread Starter [wpwcm](https://wordpress.org/support/users/wpwcm/)
 * (@wpwcm)
 * [11 years, 8 months ago](https://wordpress.org/support/topic/not-saving-anymore/#post-5267393)
 * thanks. done, but nothing in the file.
    I even changed that : define( ‘WP_DEBUG’,
   true);
 * note that the script is sending an email and the sending is working fine.
    and
   the return $formData; is still there too.
 * i did create a very basic form and it’s saving the data 100% fine in the DB.
   
   so, there is something wrong in my enhanced form code. I guess i have to created
   it again, and test step by step, to understand at what moment it get bad.
 *   Forum: [Plugins](https://wordpress.org/support/forum/plugins-and-hacks/)
    In
   reply to: [[Contact Form DB] not saving anymore](https://wordpress.org/support/topic/not-saving-anymore/)
 *  Thread Starter [wpwcm](https://wordpress.org/support/users/wpwcm/)
 * (@wpwcm)
 * [11 years, 8 months ago](https://wordpress.org/support/topic/not-saving-anymore/#post-5267369)
 * Thank you for your response and the hack in the code to display the info 🙂
 * it displays all the info in my form fine :
 *     ```
       Array
       (
           [user_info_nonce] => 7534f23fce
           [_wp_http_referer] => /infos/test
           [form_title] => test
           [test_book] => Array
               (
                   [0] => book1
               )
   
           [test_name] => MYNAME
           [test_firstname] => myfirstname
           [test_phone] => 457898
           [test_email] => myemail@mail.com
       )
   
       Array
       (
       )
       ```
   
 *   Forum: [Plugins](https://wordpress.org/support/forum/plugins-and-hacks/)
    In
   reply to: [[Advanced Page Manager] Can't add pages](https://wordpress.org/support/topic/cant-add-pages-9/)
 *  [wpwcm](https://wordpress.org/support/users/wpwcm/)
 * (@wpwcm)
 * [11 years, 8 months ago](https://wordpress.org/support/topic/cant-add-pages-9/#post-5108992)
 * Hi,
    I have exatly the same issue. It’s not possible to create/add any page once
   the plugin is activated. Once deactivated, then it’s possible to create a new
   page again. Note that it is possible to create an article ! So, the issue is 
   only for pages. Wordpress 3.9.2 Advanced Page Manager 1.3 latests releases of
   plugins installed : Contact Form 7 Contact Form DB BackWPup
 *   Forum: [Plugins](https://wordpress.org/support/forum/plugins-and-hacks/)
    In
   reply to: [[Contact Form DB] How not to save data when data is detected as bad](https://wordpress.org/support/topic/how-not-to-save-data-when-data-is-detected-as-bad/)
 *  Thread Starter [wpwcm](https://wordpress.org/support/users/wpwcm/)
 * (@wpwcm)
 * [11 years, 10 months ago](https://wordpress.org/support/topic/how-not-to-save-data-when-data-is-detected-as-bad/#post-5056243)
 * the only solution I found is to put an exit(); before the “return $formData;”
   
   then, in that case, it’s not saving the info.
 * but i found this solution inelegant ?
 *   Forum: [Plugins](https://wordpress.org/support/forum/plugins-and-hacks/)
    In
   reply to: [[Contact Form DB] How not to save data when data is detected as bad](https://wordpress.org/support/topic/how-not-to-save-data-when-data-is-detected-as-bad/)
 *  Thread Starter [wpwcm](https://wordpress.org/support/users/wpwcm/)
 * (@wpwcm)
 * [11 years, 10 months ago](https://wordpress.org/support/topic/how-not-to-save-data-when-data-is-detected-as-bad/#post-5056242)
 * Thank you Michael for your time.
 * About regex, I’m used to use # instead of / since a long time (result is the 
   same).
    Forgetting the ” for vars was definitely a bad writing (I did correct
   that).
 * Sorry, I realize that i didn’t explain well the issue.
    data was corrected/changed
   well and saved.
 * if i do the $formData->posted_data = null; then it’s cleaning the data from the
   form, but the form is still saving the “Submitted” the “Submitted Login” and “
   Submitted From” datas (all the others being empty).
    If data is ok, i want to
   keep these 3 submitted fields. but when it’s not ok, then i want nothing to be
   saved as it seems that $formData is not the only things saved (the three other
   fields). doing then $formData->posted_data[‘Submitted’] = “”; is deleting the
   value. but doing $formData->posted_data[‘Submitted Login’] = null; $formData-
   >posted_data[‘Submitted From’] = null; doesn’t delete the values. and thus a 
   new record is saved
 *   Forum: [Plugins](https://wordpress.org/support/forum/plugins-and-hacks/)
    In
   reply to: [[Contact Form DB] How not to save data when data is detected as bad](https://wordpress.org/support/topic/how-not-to-save-data-when-data-is-detected-as-bad/)
 *  Thread Starter [wpwcm](https://wordpress.org/support/users/wpwcm/)
 * (@wpwcm)
 * [11 years, 10 months ago](https://wordpress.org/support/topic/how-not-to-save-data-when-data-is-detected-as-bad/#post-5056207)
 * Thanks for helping 🙂
 * function chkValues($formData) {
    // Change $formData if (isset($formData->posted_data[
   brochure_firstname])) { $formData->posted_data[brochure_firstname]=ucfirst(strtolower(
   safe_sql($formData->posted_data[brochure_firstname]))); $formData->posted_data[
   brochure_email]=strtolower(safe_sql($formData->posted_data[brochure_email]));
   $formData->posted_data[brochure_name]=strtoupper(safe_sql($formData->posted_data[
   brochure_name])); $formData->posted_data[brochure_phone]=preg_replace(“#[^0-9]
   +#”,””,safe_sql($formData->posted_data[brochure_phone])); } else { $formData-
   >posted_data[subscribe_email]=preg_replace(“#[^0-9a-z@\._\-]+#i”,””,strtolower(
   safe_sql($formData->posted_data[subscribe_email]))); if (!filter_var($formData-
   >posted_data[subscribe_email], FILTER_VALIDATE_EMAIL)) { $formData->posted_data[
   subscribe_email]=””; } } $formData->posted_data[‘uri’] = $_SERVER[‘REQUEST_URI’];
   return $formData; // be sure to return it }
 *   Forum: [Plugins](https://wordpress.org/support/forum/plugins-and-hacks/)
    In
   reply to: [[Contact Form DB] How not to save data when data is detected as bad](https://wordpress.org/support/topic/how-not-to-save-data-when-data-is-detected-as-bad/)
 *  Thread Starter [wpwcm](https://wordpress.org/support/users/wpwcm/)
 * (@wpwcm)
 * [11 years, 10 months ago](https://wordpress.org/support/topic/how-not-to-save-data-when-data-is-detected-as-bad/#post-5056077)
 * Thanks.
    The weird thing is that if i set up to null either the $formData->title(
   even doing unset($formData->title);) of the form or the return value, then it
   saves a value.
 * i’ve playing around with the array described in the doc without success in my
   chkValues :
    $formData = (object) array( ‘submit_time’ => 1339365804.7815, //
   float Unix timestamp with microseconds ‘ip’ => ‘192.168.1.1’, // string IP address‘
   user’ => ‘admin’, // string user name if submitter was logged in. May be null‘
   title’ => ‘Form name string’, ‘posted_data’ => array(/* key=>value for each field
   in the form */), ‘uploaded_files’ => null );
 * I’m doing something wrong but don’t find what….

Viewing 8 replies - 1 through 8 (of 8 total)