Post + form + action + results on the same page

Use this code <?php if(isset($_REQUEST[‘submit_btn’])) { echo “<div>”; $name = $_POST[“names”]; echo “</div>”; $ins=”insert into tablename (fieldname)values(‘$name’) “; $conn->query($ins); ?> <script> alert(‘inserted successfully’); </script> <?php $sel=”select * from tablename”; $r=$conn->query($sel); while($u=$r->fetch_object()) { echo $u->fieldname; } } ?> <form action=”” method=”POST”> <input type=”text” name=”names” id=”names”> <input type=”submit” value=”submit” name=”submit_btn”> </form> Hope this will help you

Creating a contact form with Laravel frontend

There is a plugin by the creators of ContactForm7, called Flamingo, intended to saving the comments people does in pages, etc. Actually it uses custom post-types to capture the comments people send. To take advantage of it you should store the submissions of your form as comments, if you are hesitant of importing the comments … Read more

Adapt PHP form action for WordPress?

I think your action URL is wrong. Did you try with <?php echo plugins_url( ‘listrak-newsletter-api.php’, __FILE__ ); ?> like this way: echo ‘<form action=”‘ . plugins_url( ‘listrak-newsletter-api.php’, __FILE__ ) . ‘” method=”post”>’; in your code? Anyway I still recommend you to use WP AJAX to do this. Read here for more information.

How to retrieve form data?

You were almost there. I have modified your code. You could try this: <?php add_action(‘admin_menu’, ‘my_plugin_create_menu’); function my_plugin_create_menu() { //create new top-level menu add_menu_page( ‘My Plugin’, ‘myCust Form’, ‘administrator’, ‘insert-my-plugin_bro’, ‘my_plugin_settings_page’, ‘dashicons-translation’, ’60’ ); //call register settings function add_action( ‘admin_init’, ‘register_my_plugin_settings’ ); } function register_my_plugin_settings() { //register our settings register_setting( ‘my-plugin-settings-group’, ‘display_name’ ); } function … Read more

Hata!: SQLSTATE[HY000] [1045] Access denied for user 'divattrend_liink'@'localhost' (using password: YES)