WordPress.org

Ready to get started?Download WordPress

Forums

Form Maker
[resolved] Sending data from the form, to my own created MySQL database table (3 posts)

  1. azibux1
    Member
    Posted 2 months ago #

    Hi all,

    I see the information from a submitted form is sent to the wp-formmaker_submits database table, but is there a way to send it to a different database table please?

    I have tried using PHP that is run after the form is submitted, but the values don't seem to get passed to the variable I've created. I understand I haven't actually sent it to the database table, but that's because I get errors which I think are caused by my $firstName variable being empty. The test variable is successfully posted to the screen but the firstname one doesn't show anything.

    For info, the PHP is being run after submission by entering it in the box in the 'actions after submission' option of the form

    My PHP is below. Hope you can help :) Thanks!

    Info:

    $con=mysqli_connect("localhost","user","password","wordpress");
    // Check connection
    if (mysqli_connect_errno()) {
      echo "Failed to connect to MySQL database: " . mysqli_connect_error();
    }
    
    $firstName = $_POST['1_element_first10'];
    $test = "Test";
    
    echo $firstName;
    echo $test;

    HTML shows the text input as <input id ="1_element_first10" ......etc

    So I assumed that my PHP is correct, I also tried it with #1_element_first10 as the firefox developer 'inspector' shows it as input#1_element_first10.input_deactive but that doesn't work either. Hope you can help :)

    https://wordpress.org/plugins/form-maker/

  2. webdorado
    Member
    Plugin Author

    Posted 2 months ago #

    Dear azibux1,

    SQL mapping is under development now and it will be available in future updates. You can either wait or do that yourself. Echo will not print what you have written as after submitting the form the data is being saved on database and is being sent to emails and after that redirection takes place. The function name where you can add your changes is function savedata() which is in front-end-formmaker.php file.

  3. azibux1
    Member
    Posted 2 months ago #

    Already replied via email, but as I said thanks! I will try to implement it myself maybe by tweaking the code :)

Reply

You must log in to post.

About this Plugin

About this Topic