[ad_1]
I have a custom WordPress page template where I wrote a basic form structure like this:
<div class="my-form">
<h2>WILL YOU ATTEND?</h2>
<form action="#" autocomplete="off" method="POST">
<input class="input" type="text" spellcheck="false" name="name" placeholder="Name" required>
<input class="input" type="email" spellcheck="false" name="email" placeholder="E-mail" required>
<label class="ans">Yes
<input type="radio" name="radio">
<span class="checkmark"></span>
</label>
<label class="ans">No
<input type="radio" name="radio">
<span class="checkmark"></span>
</label>
<button> SUBMIT </button>
</form>
</div>
Now once the submit button is clicked, I’m trying to figure out how to create a table in WordPress database, and insert the form data into it using $wpdb
.
PS: I left the action
attribute empty because I don’t know how to go about this exactly.
[ad_2]