How to insert HTML/JavaScript form into WordPress page? [closed]

You have a bunch of issues: 1. WordPress part: Your function is hooked to wp_enqueue_scripts and should be like this: function wpse238953_calculate() { wp_enqueue_script(‘calculate’, plugins_url(‘/js/calculate.js’), __FILE__), array(‘jquery’), false); } add_action(‘wp_enqueue_scripts’, ‘wpse238953_calculate’); Note the different spellings between wp_enqueue_scripts and wp_enqueue_script 2. The HTML/JS part: Let’s add some id to the two input fields so that it’s … Read more

How to get the value of input hidden html from text editor to custom page template?

If you’re not specifying a page, then you would access the $_POST data on the same page as your form. print_r( $_POST ); if ( isset( $_POST[ ‘firstname’ ] ) ) { echo $_POST[ ‘firstname’ ] . ‘ ‘ . $_POST[ ‘lastname’ ]; wp_die(); } else { ?> <form method=”POST”> First name:<br> <input type=”text” name=”firstname” … Read more

Input data from email form not going to JSON file

I have checked the code. file_put_contents function accepts the absolute path for the file. Use the ‘get_template_directory()’ function for the absolute path. Please check the updated code. <form method=”get”><p id=”myform”><input type=”email” name=”EMAIL” placeholder=”enter email address” required /> <input id=”submit” name=”submit” type=”submit” value=”Sign up” /></p></form> if (isset($_POST[‘submit’])) { $file = get_template_directory() . ‘/data.json’; $json_string = json_encode($_POST, … Read more

Redirect in form handler causing form to be submitted twice

You can fix it through Session. try function vv_process_profile_forms() { session_start(); if ( isset( $_POST[‘action’] ) && $_POST[‘action’] == ‘profile-form’ ) { if ( ! isset( $_SESSION[‘form-submit’] ) ) { // form processing code here $_SESSION[‘form-submit’] = 1; $redirect_page = get_permalink( 586 ); wp_redirect( $redirect_page ); exit; } else { unset( $_SESSION[‘form-submit’] ); } } … Read more

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