I'm currently writing a chat program in PHP and AJAX and have PHPMailer installed and in use.
The chat program will be available to businesses who join my site so they can live chat to their clients. I need to be able to provide clients with an easy way to start chatting with a business without having to go through the rigmarole of waiting to receive an email then clicking a link to get verified.
Currently my email checking is done first through Javascript as follows;
// Chat Start - Validate Input Data - Chat Start Email
$(document).on('input','#csmail',function() {
var csmail=$("#csmail").val();
var regex = /^([a-zA-Z0-9_\.\-\+])+\@(([a-zA-Z0-9\-])+\.)+([a-zA-Z0-9]{2,4})+$/;
if(!regex.test(csmail)) {
$("#csemail").html("Email Address <span class='red'>invalid!</span>");
} else {
$("#csemail").html("Email Address");
}
});
Then a further check is done via PHP and an AJAX response is sent back after the email domain has been checked, code below is when domain validation fails;
<?php
// Email
$csmail = mysqli_real_escape_string($con_usr_pub, $_POST['csmail']);
$csmail_host = strtolower(substr(strrchr($csmail, "@"), 1));
$csmail_host = idn_to_ascii($csmail_host.'.');
if (filter_var($csmail, FILTER_VALIDATE_EMAIL) === false || !checkdnsrr($csmail_host, "MX")) {
$response[] = "email";
}
?>
The issue is that only the domain is being checked here and this will inevitably allow misuse of chat to occur so my question is: is there a way to use PHPMailer to contact an email address and get a result back which can be used to properly verify the full email address? Or is there any other way an email can be fully verified without relying on the user to wait for an email to be sent and them clicking on a link?
Many thanks.
How we can insert header and footer in google docs with google docs api using PHP code
Writing a new and appending a file in PHP without erasing contents
How to combine 2 arrays with the condition that 2 and 5 values will be from the second array?
How to keep the ?error on url if page extension not included?
I'm attempting to convert a piece of PHP code to dart and I came across a few things I've simply never used before, one of which is a single pipe |Im not sure what the exact dart equivalent is, if there even is one
I'm trying to convert a piece of PHP code to dart and getting stuckWhat I have is a PHP array text that gets run through a function called toUTF8 as follows:
I have a Details page that displays "short description", "Duration", and "description of tour" from a database
I'm still on the learning slopes with Guzzle, but am stumped with this issue