/****************************************************************************************************************/
/*Description: This code will implement how to perform email validation for form submission by using using php. */
/* For information, please visit https://www.mailboxvalidator.com/ */
/****************************************************************************************************************/
/* You can obtain a free account at https://www.mailboxvalidator.com/pay/9 */
Sign Up Page
Sign Up
$value)
{
$query .= '&' . $key . '=' . rawurlencode($value);
}
$try = 0;
do
{
////////////
//For https request, please make sure you have enabled php_openssl.dll extension.
//
//How to enable https
//- Uncomment ;extension=php_openssl.dll by removing the semicolon in your php.ini, and restart the apache.
//
//In case you have difficulty to modify the php.ini, you can always make the http request instead of https.
////////////
$result = file_get_contents('https://api.mailboxvalidator.com/v1/validation/single?key=' . $apiKey . $query);
}while(!$result && $try++ < 3);
$data = json_decode($result);
//Check if query is success
if ($data->is_syntax=='True')
{
//Get the data from database
$query_email = "SELECT email FROM signup WHERE email='$email'";
$query_run_email = mysqli_query($conn,$query_email);
//Check the input with database
if (mysqli_num_rows($query_run_email))
{
header( "refresh:0; url= signup.php" );
echo '';
}
else
{
//Insert data into database
$sql = "INSERT INTO signup(email,password)VALUES ('$email', '$pass')";
mysqli_query($conn, $sql);
//The message of account create successful
header( "refresh:0; url= signup.php" );
echo '';
}
}
else
{
//Error message of validation
header( "refresh:0; url= signup.php" );
echo '';
}
/* if need more information below is the example of error message
else if ($data->is_free=='True')
{
header( "refresh:0; url= signup.php" );
echo '';
}
else if ($data->is_domain=='False')
{
header( "refresh:0; url= signup.php" );
echo '';
}
else if ($data->is_suppressed == 'True')
{
header( "refresh:0; url= signup.php" );
echo '';
}
else if ($data->is_verified == 'False')
{
header( "refresh:0; url= signup.php" );
echo '';
}
*/
}
?>