how to transfer mysqli to wordpress?

this code works with php but how to use it for wordpress?
Hope you can help me! iam currently learing to build a wordpress site from the scratch. But this is not working for some reason

  Template Name: inlog
  <!-- Form -->
  <!-- After the user fills in the form, the application wil check if it already exists -->
  <!-- If it already exitsts the user will get the option to get directed to the result page -->
  <!-- Else the user will get directed to the band form -->
  <form method="POST" class="main_form" action="">
    <div class="main_form_input">
      <input type="text" name="name" required placeholder="Username">
      <input type="text" name="email" required placeholder="Email">
      <input type="submit" name="Submit" value="Log In">
    mysql_connect('localhost', 'root', '');
// Get values from form 
// Insert data into mysql 
$sql="INSERT INTO klant(naam, email, date) VALUES ('$name', '$email', Now())";
 header("Location: ./pages/voting_page.php");

Read more here: how to transfer mysqli to wordpress?

Leave a Reply

Your email address will not be published. Required fields are marked *