Checking if the data already exsis in the wp database – custom plugin
You can improve your code a lot. I’ll treat the email address as the student’s unique identification, since I can definitely have 2 students named ‘John Doe’. global $wpdb; $tablename = $wpdb->prefix.”students”; if(isset($_POST[‘submit’])){ $name = esc_attr($_POST[‘firstname’]); $surname = esc_attr($_POST[‘lastname’]); $email = sanitize_email($_POST[’email’]); if(!is_email($email)) { //Display invalid email error and exit echo ‘<div class=”error”><p>Invalid e-mail!</p></div>’; //return … Read more