How to validate Basic sign up form in php?
Validate sign up form in php
if(isset($_POST['signup'])) { extract($_POST); global $wpdb; $table_name = $wpdb->prefix . "shopkeeper_signup"; $results = $wpdb->get_results ( "SELECT * FROM $table_name where phonenumber=$phonenumber" ); if((count($results)) < 1 ){ if(($wpdb->insert($table_name, array( 'fullname' => $fullname, 'phonenumber' => $phonenumber, 'pass' => $pass, 'time' => date('d-m-Y'), )))){ $msg = "Thank You!<br>You are now registered with us.<br>click here to <a style='color:#FFEB3B' href=".site_url().">login</a>"; } else { $msg = "Something is wrong!"; } } else { $msg = "You are already registered with us!<br>click here to <a style='color:#FFEB3B' href=".site_url().">login</a>"; } }
POST COMMENTS