XAMPP local -> Working / Online -> Not Working

Home Forums Quform WordPress XAMPP local -> Working / Online -> Not Working

This topic is: not resolved
Viewing 3 posts - 1 through 3 (of 3 total)
  • Author
    Posts
  • #3214

    Hi guys,

    I don’t see the forest for the trees anymore.

    I wrote a plugin to get some custom post types, custom taxonomies und custom fields working as a business directory. Well, it’s running. To get the user’s data into my database I’m using QuForm (newest version).

    So I set up a form with 1 file upload, 22 text fields and areas and a group of multiple choice checkboxes. The file upload path I changed to an individual path. Then I wrote a script that saves the form data to my wordpress database. To get it working I used your tutorial at https://support.themecatcher.net/quform-wordpress/guides/integration/creating-a-post. The script is part of the plugin.php file – not part of functions.php.

    Well, on my local test site with XAMPP everything works fine. Online it does not. To be honest: I don’t know why. Only the file upload is working correctly. The chosen JPG picture is stored in the right (changed) path. But that means, that my script is executed (file upload ist the last part of it).

    I tried to change lots of things from plugin.php to functions.php, from flash uploader to normal upload, from setting it up without an with required fields. I deleted all that unnecessary stuff in my script file and reduced it to


    $title = $form->getValue('iphorm_3_1');
    $content = $form->getValue('iphorm_3_2');
    $post = array('post_title' => $title,'post_content' => $content);
    wp_insert_post($post);

    In that and in all the other cases print_r($post) or echo wp_insert_post($post); do not show anything. The script does not save form data to database. On my local site with XAMPP everything is up and running.

    Yes, I checked the unique IDs of the form generator an those im my script.

    Do you have any ideas? I don’t see the forest for the trees anymore. I’m hunting my bug for the last two days… 😉

    Regards
    Matthias

    #3215

    I’m not kidding. 😉 I tried to find the solution during the last two days. While writing my first post I remembered the wordpress debugging via wp-config.php. I did it and debug.log showed me what’s going wrong.

    In the database configuration you can setup the use of the wordpress database or another one. Don’t blame me for that, but right there the configuration was NOT to use the wp database. I changed that and…. tadaaa… it works.

    From time to time writing or talking about problems helps to solve them. 😉

    Regards from Germany
    Matthias

    #3232
    Ally
    Support Staff

    You don't have permission to view this content. Please log in or register and then verify your purchases to gain access.

Viewing 3 posts - 1 through 3 (of 3 total)
  • You must be logged in to reply to this topic.
Be inspired. © 2024 ThemeCatcher Ltd. 20-22 Wenlock Road, London, England, N1 7GU | Company No. 08120384 | Built with React | Privacy Policy