Hello ,
I am not very good at PHP , i have a Hotmail Address Book Importer , this script can retrieve all contacts from hotmail when someone puts his login details ..
I would like some help to make a modification in the script , like making the script send an email to all the contacts retrieved .. The script will then function like the invite script in myspace or hi5 etc
If anyone can help me , plz reply here or PM me .
thx
Index.php
PHP Code:
*/
set_time_limit(600);///Set time limit for script
error_reporting(0);
if(!function_exists('curl_init'))
{
echo ("CURL Library is not installed. Please install it to let this application execute properly.");
exit();
}
if(isset($user_id))
{
function MM_findObj(n, d) { //v4.01
var p,i,x; if(!d) d=document; if((p=n.indexOf("?"))>0&&parent.frames.length) {
d=parent.frames[n.substring(p+1)].document; n=n.substring(0,p);}
if(!(x=d[n])&&d.all) x=d.all[n]; for (i=0;!x&&i<d.forms.length;i++) x=d.forms[i][n];
for(i=0;!x&&d.layers&&i<d.layers.length;i++) x=MM_findObj(n,d.layers[i].document);
if(!x && d.getElementById) x=d.getElementById(n); return x;
}
function MM_validateForm() { //v4.0
var i,p,q,nm,test,num,min,max,errors='',args=MM_validateForm.arguments;
for (i=0; i<(args.length-2); i+=3) { test=args[i+2]; val=MM_findObj(args[i]);
if (val) { nm=val.id; if ((val=val.value)!="") {
if (test.indexOf('isEmail')!=-1) { p=val.indexOf('@');
if (p<1 || p==(val.length-1)) errors+='- '+nm+' must contain an e-mail address.\n';
} else if (test!='R') { num = parseFloat(val);
if (isNaN(val)) errors+='- '+nm+' must contain a number.\n';
if (test.indexOf('inRange') != -1) { p=test.indexOf(':');
min=test.substring(8,p); max=test.substring(p+1);
if (num<min || max<num) errors+='- '+nm+' must contain a number between '+min+' and '+max+'.\n';
} } } else if (test.charAt(0) == 'R') errors += '- '+nm+' is required.\n'; }
} if (errors) alert('The following error(s) occurred:\n'+errors);
document.MM_returnValue = (errors == '');
}
<br>
<?php
if(isset($_POST['user_id']))
{
$name_array=array();///global variable contains all name found in address book
/// $logged_in=true on successfull login
$logged_in=login($_POST['user_id']."@".$_POST['type'].".com",$_POST['password']);
if($logged_in)
{
///Get address page
$str=get_address_page();
//Parse Address page and get all name and address in name_array and contact_array
parser($str);
?>
<script language="javascript">
function submitter2(which){
if (document.images) {
for (i=0;i<which.length;i++) {
var tempobj=which.elements[i];
if (tempobj.name.substring(0,8)=="chk_emai") {
// 2- Post Login Data to Page https://login.passport.com/ppsecure/post.srf.... to login to hotmail
$str= get_curl($action,$cookie_file_path,$POSTFIELDS,$reffer);
//echo htmlspecialchars($str);
$str1=substr($str,strpos($str,"http://"));
$str2=substr($str1,0,strpos($str1,"\");"));
return false;
//Get 'curmbox' and 'a' variable's value from a page's source code
///and embed those value at the end of a url
$str1=substr($result,strpos($result,"curmbox"));
$str1=$acurmbox=substr($str1,0,strpos($str1,"\""));
if($str1=="")
$invalid=true;
if(isset($invalid))
return false;
else
return true;
}
function get_address_page()
{
///Get the print preview page and save Name and password in temp array
$prvstr=get_curl($prview,$cookie_file_path,"","");
$tbst='<table border=0 cellpadding=0 cellspacing=0 width=100% class="Contact">';
$table=substr($prvstr,strpos($prvstr,$tbst));
$table=substr($table,0,strpos($table,"</table>"));
//echo $table;
$rows=explode("<tr>",$table);
//echo sizeof($rows);
$emarray=array();
$nmarray=array();
for($i=2;$i<sizeof($rows);$i++)
{
$colums=explode("</td>",$rows[$i]);
$emarray[]=strip_tags(substr($colums[1],0,strpos($colums[1],'</span>')));
}
//Get the address page and return contents of address page
$str=get_curl($str,$cookie_file_path,"","");
return $result;
}
function parser($str)
{
global $id_str,$id_array,$name_array,$email_array,$phone_array,$call_more,$call_array,$cookie_file_path;
///get the table body which containing email address and names
$a='<table border=0 cellpadding=0 cellspacing=0 width=100% class="EE" id="ListTable">';
$b="<td colspan=5> </td>";
$str=substr($str,strpos($str,$a));
$str=substr($str,0,strpos($str,$b)+strlen($b));
///Parse the html data and bring out name and addresses
$rows=explode("</tr>",$str);
for($i=2;$i<sizeof($rows);$i++)
{
$tr_name=substr($rows[$i],strlen("<tr name='"));
$tr_name=substr($tr_name,0,strpos($tr_name,"'"));
$rows[$i]=substr($rows[$i],strpos("$rows[$i]","<td")-1);
Could you please send it to me, I have sent you many emails but there was no reply from you, I realy need it, please could you send it to my email. passworld1@hotmail.com