Form submit fails
-
Hello
I created this code snippet, according to forum help, and activated it:add_action( 'template_redirect', function () { if ( ! is_page( 82154 ) || ! isset( $_POST['name'] ) ) { return; } $name = $_POST['name']; // process submitted data here echo $name; } );Then a page with ID 82154 with a form:
<form action="" method="POST"> <label>Nome</label> <input name="name" required="" type="text" /> <label>Cognome</label> <input name="surname" required="" type="text" /> <label>A quale evento vuoi iscriverti?</label> <select name="event" required=""> <option hidden="" selected="selected" value="">-</option> <option value="uno">Lorem</option> <option value="due">Ipsum</option> <option value="tre">Dolor</option> <option value="quattro">Sit</option> <option value="cinque">Amen</option> <option value="sei">Latinum</option> </select> <label>eMail</label> <input name="email" required="" type="text" /> <input type="submit" value="Submit" /> </form> When I test the page, I get a “Oops! Something went wrong…”
I think I followed the indication, but I cannot understand what is wrong.Thanks for help!
Alberto
Viewing 3 replies - 1 through 3 (of 3 total)
Viewing 3 replies - 1 through 3 (of 3 total)
The topic ‘Form submit fails’ is closed to new replies.