How to submit a form
-
I am new to plugin development.
I have created a page (accessed via shortcode) with a form for the user to fill out. The problem is, when they press the Submit button, it’s taking them to a page that doesn’t exist—and I want them coming back to this page.
Here’s what I’ve got—
<?php // disable direct file access if ( ! defined( 'ABSPATH' ) ) { exit; } // define variables and set to empty values $nickname = ""; ?> <form method="post" action="<?php echo htmlspecialchars($_SERVER["PHP_SELF"]);?>"> Nickname <input type="text" name="nickname"><br> <input type="submit"> </form> <?php echo $nickname;Any help would be greatly appreciated. Thanks.
Viewing 2 replies - 1 through 2 (of 2 total)
Viewing 2 replies - 1 through 2 (of 2 total)
The topic ‘How to submit a form’ is closed to new replies.