Preg_match_all email finder
Posted: Sat Jan 18, 2014 2:57 pm
Hii
COD------
<?
/////////////////////////////////////////////////////////////////////
$ossz = mysql_connect("localhost", "root", "nico5") or die(mysql_error());
mysql_select_db("linkkereso",$ossz) or die(mysql_error());
//////////////////////////////////////////////////////////////////////
$email_sql = "select * from email ";
$eredmeny = mysql_query($email_sql) or die(mysql_error());
///////////////////////////////////////////////////////////////////////////////
//*****************************************************************************
// http://weblabor.hu/forumok/temak/15793
// $link-- 3 piece email adress
$link = "http://localhost/pok/proba.html";
$forras = file_get_contents($link);
if (preg_match_all("/\b[A-Z0-9._%-]+@[A-Z0-9.-]+\.[A-Z]{2,4}\b/i", $forras, $tomb))
{
for($x=0;$x<count($tomb);$x++)
{
for($y=0;$y<count($tomb[$x]); $y++ )
{
if ($tomb[$x][$y] != "http")
{
print $tomb[$x][$y]."\r\n<br />";
$ujlink = "insert into email values ('', '$tomb[$x][$y]', '', '', '', '')";
mysql_query($ujlink) or die(mysql_error());
}
}
}
}
?>
The print $tomb[$x][$y] I would like to save database but do not know how to ?
Thanks in advance !
COD------
<?
/////////////////////////////////////////////////////////////////////
$ossz = mysql_connect("localhost", "root", "nico5") or die(mysql_error());
mysql_select_db("linkkereso",$ossz) or die(mysql_error());
//////////////////////////////////////////////////////////////////////
$email_sql = "select * from email ";
$eredmeny = mysql_query($email_sql) or die(mysql_error());
///////////////////////////////////////////////////////////////////////////////
//*****************************************************************************
// http://weblabor.hu/forumok/temak/15793
// $link-- 3 piece email adress
$link = "http://localhost/pok/proba.html";
$forras = file_get_contents($link);
if (preg_match_all("/\b[A-Z0-9._%-]+@[A-Z0-9.-]+\.[A-Z]{2,4}\b/i", $forras, $tomb))
{
for($x=0;$x<count($tomb);$x++)
{
for($y=0;$y<count($tomb[$x]); $y++ )
{
if ($tomb[$x][$y] != "http")
{
print $tomb[$x][$y]."\r\n<br />";
$ujlink = "insert into email values ('', '$tomb[$x][$y]', '', '', '', '')";
mysql_query($ujlink) or die(mysql_error());
}
}
}
}
?>
The print $tomb[$x][$y] I would like to save database but do not know how to ?
Thanks in advance !