How to hide the form after successful php execution

If I understand the code correctly, you are wanting to make the result_display() function call conditional by moving the post check to inside the shortcode function. ie. function display_shortcode() { ob_start(); if (isset($_POST[‘submit’])) {result_display();} else {html_form_code();} return ob_get_clean(); }

form does not generate $_POST request

According to the WP codex, the submit_button in WP will generate the HTML code for the submit button. (See example in Codex https://codex.wordpress.org/Function_Reference/submit_button ). So, additional info needed: what is the generated page code look like for the form? (from the Page Source). Is any code being generated? But that’s not your problem. The problem … Read more

Using AJAX on Contact-form the WordPress way

EDIT TL;DRYour page is refreshing because you tell the form to load a new page (the page specified under action). Longer answerThe reason the page refreshes is because your form has an action associated with it. When I viewed your page yesterday, I saw the AJAX routine complete, and then the page refreshed. Why? Because … Read more

How to display a page dependent on a url parameter supplied by a form/button page?

If you would show pdf in content dynamically, which page would you like to show page, post or wherever. You have to echo your shortcode in template file. For example, you have to print like below <?php echo do_shortcode(“[shortcode pdf=”. $_REQUEST[“pdf_id’] .”); ?> http://yourwebsite.com/post-title/?pdf_id=20 //your url would be like that