PHP Classes

check object

Recommend this page to a friend!

      Verify e-mail  >  All threads  >  check object  >  (Un) Subscribe thread alerts  
Subject:check object
Summary:always not exist
Messages:8
Author:Jeremiah Almario
Date:2015-03-20 14:46:30
 

  1. check object   Reply   Report abuse  
Picture of Jeremiah Almario Jeremiah Almario - 2015-03-20 14:46:30
Hi. I having problem with this class. I tried to used it here: http://allday.ph/freewifi/signin.php, this is only a test environment.
I im using this code:

include_once 'class.verifyEmail.php';
$myemail = "wifi@allday.ph";
$vmail = new verifyEmail();
$vmail->setEmailFrom($myemail);
if ($vmail->check($email)) {
//Do Nothing!!
} else {
array_push($errors, "We can't communicate with the email you provided. Kindly give us another one.");
$error_flag = 1;
}
if ($error_flag === 1){
$_SESSION['signin_error'] = $errors;
header("location: ../signin.php");
exit();
}

I dont include isValid because i have my own email format validator, so i remove it. so when the email exist the code will do nothing and proceed with my insert code to mysql. but when i try to submit a valid email for example "jeremiah.almario@gmail.com" that is my email but still it says the error.

please help.

  2. Re: check object   Reply   Report abuse  
Picture of Konstantin Granin Konstantin Granin - 2015-03-20 15:46:03 - In reply to message 1 from Jeremiah Almario
hi.
if function `check` remove or comment string:

if ($this->isValid($email)) {


and closing bracket before string:

return $result;




  3. Re: check object   Reply   Report abuse  
Picture of Jeremiah Almario Jeremiah Almario - 2015-03-24 01:43:40 - In reply to message 2 from Konstantin Granin
Hi Kons,

As far as i know, this statement will get the result if the email is good or bad. So if 'check($email)' will return true it means it is good and false it will proceed to 'else', that why i make the action for 'if ($vmail->check($email))' do nothing because if it is a good email. the user can proceed to the next step, but if not it will go to 'else' which will return an error message to the user. thats my logic.

if ($vmail->check($email)) {
//Do Nothing!!
} else {
array_push($errors, "We can't communicate with the email you provided.
Kindly give us another one.");
$error_flag = 1;
}

if i am missing some parts or if i dont understand the class kindly let me know. thanks. Your help is much appreciated. Thank bro.

  4. Re: check object   Reply   Report abuse  
Picture of Jeremiah Almario Jeremiah Almario - 2015-03-24 02:58:54 - In reply to message 2 from Konstantin Granin
kindly visit 'http://allday.ph/freewifi/inc/example.php' that is your example, and this is the code inside the 'example.php'

<?php
include_once 'class.verifyEmail.php';

$toemail = 'jeremiah.almario@gmail.com';
$fromemail = 'wifi@allday.ph';
$vmail = new verifyEmail();

$vmail->setEmailFrom($fromemail);
if ($vmail->check($toemail)) {
//Do nothing
} elseif ($vmail->isValid($toemail)) {
echo 'email &lt;' . $toemail . '&gt; valid, but not exist!';
} else {
echo 'email &lt;' . $toemail . '&gt; not valid and not exist!';
}
?>

both $toemail and $fromemail are both valid and exist. but it says 'valid but not exist'.

thanks.

  5. Re: check object   Reply   Report abuse  
Picture of Konstantin Granin Konstantin Granin - 2015-03-24 06:51:37 - In reply to message 5 from Jeremiah Almario
thanks for report. fixed.

  6. Re: check object   Reply   Report abuse  
Picture of Iam Phv Iam Phv - 2015-03-28 04:45:09 - In reply to message 6 from Konstantin Granin
Hi, i have same problem,its alway exists, my code :

function checkEmail($emailCre)
{
require_once (dirname(__FILE__) . "/../../module/mod_maccount/class.verifyEmail.php");
$vmail = new verifyEmail();
$vmail->setEmailFrom('system_noreply@baoduhoc.vn');
if ($vmail->isValid($emailCre)) {
echo 'email &lt;' . $emailCre . '&gt; exist!';
} else if ($vmail->check($emailCre)) {
echo 'email &lt;' . $emailCre . '&gt; valid, but not exist!';
} else {
echo 'email &lt;' . $emailCre . '&gt; not valid and not exist!';
}
}

  7. Re: check object   Reply   Report abuse  
Picture of Iam Phv Iam Phv - 2015-03-28 04:48:48 - In reply to message 7 from Iam Phv
Sometime have this message :
<b>Warning</b>: stream_socket_sendto(): Connection reset by peer
in on line <b>181</b><br />

  8. Re: check object   Reply   Report abuse  
Picture of Konstantin Granin Konstantin Granin - 2015-03-28 05:14:21 - In reply to message 8 from Iam Phv
Hi.
"Connection reset by peer " when:
1. Read Error
2. Write Error
3. Ping Timeout
4. Broken pipe
5. other errors

I offer:
1. increment $this->_maxStreamTimeout for example 10
2. show sample to reproduce the bug