HOME / BLOG / BLOG-POST

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>";
}
}

 


about authors

Sandip Das

Web Developer

Once a legend said “Any fool can write code that a computer can understand. Good programmers write code that humans can understand.” – Martin Fowler.



POST COMMENTS

Leave a Reply

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