Location: PHPKode > scripts > Contact Grabber And Invite > contact-grabber-and-invite/invite/index.php
<html>
<head>
<title>Contact Grabber</title>
<style type=text/css>
input.blue {background-color: #ecf1f5; font-weight: bold; font-size: 18px; color: black;}
}
</style>
<script type="text/javascript" src="http://www.plaxo.com/css/m/js/util.js"></script>
<script type="text/javascript" src="http://www.plaxo.com/css/m/js/basic.js"></script>
<script type="text/javascript" src="http://www.plaxo.com/css/m/js/abc_launcher.js"></script>
<script type="text/javascript"><!--
function onABCommComplete() {
  // OPTIONAL: do something here after the new data has been populated in your text area
}
//--></script>
</head>
<body bgcolor="f8f9fB"><center>
<center><table border="0" width="500" id="table21" cellspacing="0" cellpadding="0" style="border: 1px solid #4B89AE" bgcolor="#f8f9fB" align="center">
    <tr><br>
      <td width="91%">
        <div align="center">
          <table border="0" width="20%" id="table22" cellspacing="0" cellpadding="0" bgcolor="#ECF1F5" align="center">
               
            <tr>
<?php
error_reporting(0);
include("$_SERVER[DOCUMENT_ROOT]/includes/validate_email.inc.php");
include("$_SERVER[DOCUMENT_ROOT]/includes/connect.inc.php");
?>
<b>Contact Grabber</b><br/>
  <form method="post">
  Please enter full URL of the page to parse (including http://):<br />
  <input class="blue" type="text" name="url" size="30" /><br />
  Enter text to extract emails.<br />
  <textarea style="color: black; background-color: #ecf1f5; font-weight: bold;" id="recipient_list" name="text" cols="50" rows="15"></textarea>
<a href="#" onclick="showPlaxoABChooser('recipient_list', 'widget.html'); return false"><img src="http://www.plaxo.com/images/abc/buttons/add_button.gif" alt="Add from my address book" /></a>
  <tr>
  <td align="center" width="192" height="40" bgcolor="#f8f9fb" style="border-top: 1px solid #bfd5e3">
    &nbsp;&nbsp;
  </td>
  <td width="382" height="40" bgcolor="#f8f9fb" style="border-top: 1px solid #bfd5e3">
  <input class="formbutton" type="submit" value="Invite My Friends"></td>
  </tr>
<?php

if (isset($_POST['url']) && !empty($_POST['url'])) {

  $text = file_get_contents($_POST['url']);

}

elseif (isset($_POST['text']) && !empty($_POST['text'])) {

  $text = $_POST['text'];

}
if (!empty($text)) {

  $res = preg_match_all("/[a-z0-9]+([_\\.-][a-z0-9]+)*@([a-z0-9]+([\.-][a-z0-9]+)*)+\\.[a-z]{2,}/i",
    $text,
    $matches);
$correct=0;
  if ($res) {

    foreach(array_unique($matches[0]) as $email) {

if(validate_email($email)){
      $email = trim(mysql_real_escape_string($email));
	$q = mysql_query("SELECT `id` FROM `invites` WHERE `email` = '{$email}'");

	     if(!mysql_num_rows($q)){

		$sql = "INSERT INTO invites(email,date,ip) VALUES('$email', '".time()."', '$_SERVER[REMOTE_ADDR]')";
		$result = mysql_query($sql, $con) or die(mysql_error());
		    }				    
		}
    	    }
		$correct=1;	}
  else {
    echo "<br><font color='#f42c05'>No emails found.</font>";
  }
if($correct)
echo "</br><font color='#008000'>The invitations have been queued and will be dispatched soon.</font>";
}
?>            </table></table>
<font size=2px>Copyright <?php echo date('Y'); ?>, <a href="http://kkonline.org">Krishna Khanna</a></font>
</center> 
</body>
</html>
Return current item: Contact Grabber And Invite