PageRenderTime 50ms CodeModel.GetById 25ms RepoModel.GetById 0ms app.codeStats 0ms

/site/importer/myhotmail.php

https://bitbucket.org/kaerast/ppl
PHP | 76 lines | 35 code | 20 blank | 21 comment | 6 complexity | 7807b424ddcbbf480c0b5611deb3c405 MD5 | raw file
Possible License(s): GPL-2.0, AGPL-1.0
  1. <?
  2. /////////////////////////////////////////////////////////////////////////////////////////
  3. // //
  4. // //
  5. // //
  6. // HOTMAIL CONTACT IMPORTING SCRIPT //
  7. // COPYRIGHT RESERVED //
  8. // //
  9. // You may not distribute this software without prior permission //
  10. // //
  11. // //
  12. // WWW.GETMYCONTACTS.COM //
  13. // //
  14. /////////////////////////////////////////////////////////////////////////////////////////
  15. //******************************* | SETTING VARIABLES | ***********************************\\
  16. $service = 'hotmail';
  17. include_once ('includes/config.php');
  18. include_once ('includes/tbs_class.php');
  19. include ('includes/service.php');
  20. //CHECKING IF LOGIN WAS SUCCESSFUL
  21. //////////////////////////////////
  22. $result=@html_entity_decode($result);
  23. @preg_match_all('/([_a-zA-Z0-9-]+(\.[_a-zA-Z0-9-]+)*@[a-zA-Z0-9-]+(\.[a-zA-Z0-9-]+)*(\.[a-z]{2,3}))/', $result, $matches);
  24. $loop = count($matches[0]);
  25. //pull out a test email
  26. $test_email = @html_entity_decode($matches[1][0]);
  27. //check if test email was found
  28. if ($loop < 0 || !eregi("^[_a-zA-Z0-9-]+(\.[_a-zA-Z0-9-]+)*@[a-zA-Z0-9-]+(\.[a-zA-Z0-9-]+)*(\.[a-z]{2,3})$", $test_email)) {
  29. $show = 1;
  30. $error_message = "No contacts found - check your login details and try again";
  31. }
  32. else {
  33. //Start Building Final Array
  34. ////////////////////////////
  35. $display_array = array();
  36. $email_only_array = array();//to remove duplicates
  37. for ($count = 0; $count <= $loop; $count++) {
  38. $email = trim($matches[0][$count]);
  39. //validate email and check for duplicates
  40. if (eregi("^[_a-zA-Z0-9-]+(\.[_a-zA-Z0-9-]+)*@[a-zA-Z0-9-]+(\.[a-zA-Z0-9-]+)*(\.[a-z]{2,3})$",$email) && !in_array($email, $email_only_array)) {
  41. list($dataname, $domain) = split('@', $email);
  42. $result = array('contacts_email' => $email, 'contacts_name' => $dataname);
  43. $display_array[] = $result;
  44. $email_only_array[] = $email; //to remove duplicates
  45. }
  46. }
  47. $poweredby_bottom = $footer;//powered by
  48. $show_result = 1;//show results table
  49. unlink($username);//deleting csv file
  50. @unlink($mycookie);
  51. }
  52. $table = 1;//show table in main template (email or cvs upload)
  53. $service = 'myhotmail';
  54. @unlink($mycookie);
  55. include_once ('index.php');
  56. ?>