forked from DukeOfMarshall/PHP---JSON-Email-Verification
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathexample.php
More file actions
52 lines (43 loc) · 1.12 KB
/
example.php
File metadata and controls
52 lines (43 loc) · 1.12 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<script src="//ajax.googleapis.com/ajax/libs/jquery/1.11.0/jquery.min.js"></script>
<title>Sample</title>
<script>
$(function(){
$("#js_verify").click(function(){
$.getJSON("EmailVerify.class.php", { "address_to_verify" : $("#email").val() }, function(data){
alert(data.message);
return false;
});
return false;
});
});
</script>
</head>
<body>
<?php
if($_POST['email']){
require_once("EmailVerify.class.php");
$verify = new EmailVerify();
if($verify->verify_formatting($_POST['email'])){
echo "Email is formated correctly<BR>\r\n";
}else{
echo "Email is NOT formated correctly<BR>\r\n";
}
if($verify->verify_domain($_POST['email'])){
echo "Domain has been verified<BR>\r\n";
}else{
echo "Domain has NOT been verified<BR>\r\n";
}
echo "<BR>\r\n<BR>\r\n";
}
?>
<form method="post">
<input type="text" name="email" id="email">
<input type="submit" value="Verify through PHP" />
<button id="js_verify">Verify through JavaScript</button>
</form>
</body>
</html>