login  Naam:   Wachtwoord: 
Registreer je!
 Reacties op script:
Scripts > PHP > Gastenboeken > Gastenboek 2.1

Pagina:  

Offline  webstab
Gepost op: 01 september 2004 - 14:14
PHP ver gevorderde



de emailcheck werkt bij mij niet.
als ik het emailadres bla12346qsdf@hotmail.com invul dan zegt hij dat dit correct is, maar dat is helemaal niet zo

Offline  cur
Gepost op: 03 september 2004 - 20:53
Nieuw lid



toppertje

Joël kan je de smileys weer uploaden ?!? ty (de oude die bij het gastenboek horen, 20x20)

Offline  Joel
Gepost op: 03 september 2004 - 22:04
Intern Manager



Citaat:
[I][B]webstab[/B] schreef op 01 September 2004 - 14:14[/I]

de emailcheck werkt bij mij niet.
als ik het emailadres bla12346qsdf@hotmail.com invul dan zegt hij dat dit correct is, maar dat is helemaal niet zo
Het checkt enkel of het e-mailadres juist is ingevuld, niet of dat bestaat, dat kan je jammer genoeg niet 

Offline  Jeroen
Gepost op: 04 september 2004 - 13:19
Onbekend



Dan weet ik meer dan jou Joël . Met de volgende code kan je perfect je email checken of hij bestaat ofniet!

  1. <?php
  2. class mail_check_global
  3. {
  4. var $system_OS = "win"; // required for MX digging (win / linux)
  5. var $debug = 0; // self-explaining (0 - OFF, 1 - ON)
  6. var $recType = "MX"; // limitting dns query to Mail eXchange only
  7. var $email; // the goal! ;)
  8. var $hostName; // parent domain for address
  9. var $userName; // actually NOT used :)
  10. var $check_DNS_result; // debuging DNS check
  11. var $check_MAIL_result; // debuging SYNTAX check
  12.  
  13. // check if MX records in DNS server response (WINDOWS !!!):
  14. function checkDNS()
  15. {
  16. if ($this -> system_OS == "linux") // linuz
  17. {
  18. if (getmxrr($this -> hostName)) return TRUE;
  19. else return FALSE;
  20. } else { // windoz
  21. if(!empty($this -> hostName))
  22. {
  23. exec("nslookup -type=".$this->recType." ".$this -> hostName, $result);
  24. // check each line to find the one that starts with the host
  25. // name. If it exists then the function succeeded.
  26. foreach ($result as $line)
  27. {
  28. if(eregi("^".$this -> hostName,$line)) return true;
  29. }
  30. // otherwise there was no mail handler for the domain
  31. return false;
  32. }
  33. return false;
  34. }
  35. }
  36.  
  37. // brake address --> username & parent domain
  38. function check_email_dns()
  39. {
  40. list($this -> userName, $this -> hostName) = split("@", $this -> email);
  41. if (!$this -> checkDNS ($this -> hostName))
  42. {
  43. $this -> check_DNS_result = "Address domain MX DNS record could NOT be found";
  44. return FALSE;
  45. } else {
  46. $this -> check_DNS_result = "Address DNS MX is OK";
  47. return TRUE;
  48. }
  49. }
  50.  
  51. // check addresse's SYNTAX
  52. function check_email()
  53. {
  54. $this -> email = strtolower($this -> email);
  55. if (preg_match('/^[-!#$%&'*+./0-9=?A-Z^_`{|}~]+@([-0-9A-Z]+.)+([0-9A-Z]){2,4}$/i', $this -> email))
  56. {
  57. $this -> check_MAIL_result = "Address syntax is OK";
  58. return TRUE;
  59. } else {
  60. $this -> check_MAIL_result = "Address syntax is WRONG";
  61. return FALSE;
  62. }
  63. }
  64.  
  65. // global check
  66. function final_mail_check()
  67. {
  68. if (!$this -> check_email_dns() OR !$this -> check_email()) return FALSE;
  69. else return TRUE;
  70. }
  71.  
  72. // debuging ONLY
  73. function debug_address()
  74. {
  75. if ($this -> debug == 1)
  76. {
  77. echo "<br>";
  78. echo "<b>DEBUG</b>:";
  79. echo "<br>";
  80. echo "<u>eMail</u>: ".$this -> email;
  81. echo "<br>";
  82. echo "<u>DNS</u>: ".$this -> check_DNS_result;
  83. echo "<br>";
  84. echo "<u>Syntax</u>: ".$this -> check_MAIL_result ;
  85. echo "<br>";
  86. }
  87. }
  88. } ?>



  1. <?php $check = new mail_check_global; // initiate class
  2. $check -> email = "root@yahoo.com"; // REQUIRED --> address to check
  3. $check -> debug = 1; // OPTIONAL --> default is 0; values: 0 / 1
  4. $check -> system_OS = "win"; // OPTIONAL --> default is WINDOWS; values: win / linux
  5.  
  6. // USE: if($check -> final_mail_check()) ------------------ your action here --------;
  7.  
  8. // USE example:
  9. if ($check -> final_mail_check()) echo "<font style=\"color:green; font-weight:bold\">Email address IS VALID!</font>";
  10. else echo "<font style=\"color:red; font-weight:bold\">The address is NOT VALID!</font>";
  11.  
  12. $check -> debug_address(); // debuging purposes
  13. ?>


Offline  Maiky
Gepost op: 05 september 2004 - 22:49
Nieuw lid



hmm ik wil hem include zodra hij bij de volgende pagina beland laat hij het weergeven zonder layout kan iemand mij helpen ?

Offline  Joel
Gepost op: 05 september 2004 - 23:56
Intern Manager



Start maar een forumbericht wat het probleem is, met wat uitleg a.u.b.

Offline  S_A_H
Gepost op: 26 september 2004 - 20:22
Nieuw lid



heej
als ik een bericht heb getypt in schrijven en dan op verzenden druk hoort die normaal automatisch naar lezen te gaan maar hij blijft bij mij met een leeg beeld hangen in schrijven, als ik dan net zovaak op vorige druk tot ik weer bij home ben en dan weer naar lezen ga dan staat hij er wel in, wat kan het probleem zijn.

ps: verder ist een cool script ;)

Offline  Joel
Gepost op: 26 september 2004 - 21:57
Intern Manager



header ("location: lezen.php");

Deze code leest hij normaal als je een bericht verstuurt. Ik weet niet direct wat het probleem kan zijn.

Offline  S_A_H
Gepost op: 28 september 2004 - 20:09
Nieuw lid



tis al gelukt hij doet het  bedankt he jojo

Offline  webstab
Gepost op: 08 oktober 2004 - 22:48
PHP ver gevorderde



ik heb uit dit gastenboek de emailcheck gehaald:
  1. function check_email($address) {
  2. list($local, $host) = explode("@", $address);
  3. $pattern_local = "^([0-9a-z]*([-|_]?[0-9a-z]+)*)(([-|_]?)\.([-|_]?)[0-9a-z]*([-|_]?[0-9a-z]+)+)*([-|_]?)$";
  4. $pattern_host = "^([0-9a-z]+([-]?[0-9a-z]+)*)(([-]?)\.([-]?)[0-9a-z]*([-]?[0-9a-z]+)+)*\.[a-z]{2,4}$";
  5. $match_local = eregi($pattern_local, $local);
  6. $match_host = eregi($pattern_host, $host);
  7.  
  8. if($match_local && $match_host) {
  9. return 1;
  10. } else {
  11. return 0;
  12. }
  13. }


wnr het een goed emailadres is dan doet hij het goed,wnt het een fout is dan zeg hij dat het fout is(wat ook goed is) maar er komt dan ook onder: undefined offset : 1

Pagina:  

Enkel aanvullende informatie, vragen en antwoorden op vragen zijn welkom.
 
© 2002-2012 Sitemasters.be - Regels - Gehost door: Vircon - Laadtijd: 0.145s