By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
440,304 Members | 3,201 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 440,304 IT Pros & Developers. It's quick & easy.

opacity of div or body

P: 45
HI every one,
i am using tooltip on click of link and i want like when that tooltip open then background window would be blure().
can anyone help me...
Dec 5 '08 #1
Share this Question
Share on Google+
4 Replies


Markus
Expert 5K+
P: 6,050
PHP can't...

--Moving to Javascript.
Dec 5 '08 #2

acoder
Expert Mod 15k+
P: 16,027
Use a div 100% in height/width which covers the content below while the tooltip is displayed.
Dec 5 '08 #3

P: 45
hi everyone i have some in fetching a contact from hotmail i did not know what is the problem i mean i have a lot of contacts in my live id but still showing there is not contact error! i am attaching the code please provide me solution i will be very gratefull to all of u...

msn contact file :
Expand|Select|Wrap|Line Numbers
  1. <?php
  2.  
  3. class msn
  4. {
  5.  
  6.     var $server    =    'messenger.hotmail.com';
  7.     var $port    =    1863;
  8.  
  9.     var $nexus    =    'https://nexus.passport.com/rdr/pprdr.asp';
  10.     var $ssh_login    =    'login.live.com/login2.srf';
  11.  
  12.     var $debug    =    0;
  13.  
  14.  
  15.     var $curl_bin    =    0;
  16.     var $curl    =    '/usr/local/bin/curl';    // linux
  17.     //var $curl    =    'c:\curl.exe';        // windows
  18.  
  19.     //Used to prevent the script from hanging
  20.     var $count = 0;
  21.  
  22.     //Used to store the email addresses until all have been collected
  23.     var $email_input = array();
  24.     var $email_processing = array();
  25.     var $email_output = array();
  26.  
  27.     /**
  28.      *
  29.      * desc    :    Connect to MSN Messenger Network
  30.      *
  31.      * in    :    $passport    =    passport i.e: user@hotmail.com
  32.      *        $password    =    password for passport
  33.      *
  34.      * out    :    true on success else return false
  35.      *
  36.      */
  37.  
  38.     function connect($passport, $password)
  39.     {
  40.         $this->trID = 1;
  41.  
  42.         if (!$this->fp = @fsockopen($this->server, $this->port, $errno, $errstr, 2)) {
  43.  
  44.             die("Could not connect to messenger service");
  45.  
  46.         } else {
  47.               stream_set_timeout($this->fp, 2);
  48.  
  49.             $this->_put("VER $this->trID MSNP9 CVR0\r\n");
  50.  
  51.             while (! feof($this->fp))
  52.             {
  53.                 $data = $this->_get();
  54.  
  55.                 switch ($code = substr($data, 0, 3))
  56.                 {
  57.                     default:
  58.                         echo $this->_get_error($code);
  59.  
  60.                         return false;
  61.                     break;
  62.                     case 'VER':
  63.                         $this->_put("CVR $this->trID 0x0409 win 4.10 i386 MSNMSGR 7.0.0816 MSMSGS $passport\r\n");
  64.                     break;
  65.                     case 'CVR':
  66.                         $this->_put("USR $this->trID TWN I $passport\r\n");
  67.                     break;
  68.                     case 'XFR':
  69.                         list(, , , $ip)  = explode (' ', $data);
  70.                         list($ip, $port) = explode (':', $ip);
  71.  
  72.                         if ($this->fp = @fsockopen($ip, $port, $errno, $errstr, 2))
  73.                         {
  74.                             $this->trID = 1;
  75.  
  76.                             $this->_put("VER $this->trID MSNP9 CVR0\r\n");
  77.                         }
  78.                         else
  79.                         {
  80.                             if (! empty($this->debug)) echo 'Unable to connect to msn server (transfer)';
  81.  
  82.                             return false;
  83.                         }
  84.                     break;
  85.                     case 'USR':
  86.                         if (isset($this->authed))
  87.                         {
  88.                             return true;
  89.                         }
  90.                         else
  91.                         {
  92.                             $this->passport = $passport;
  93.                             $this->password = urlencode($password);
  94.  
  95.                             list(,,,, $code) = explode(' ', trim($data));
  96.  
  97.                             if ($auth = $this->_ssl_auth($code))
  98.                             {
  99.                                 $this->_put("USR $this->trID TWN S $auth\r\n");
  100.  
  101.                                 $this->authed = 1;
  102.                             }
  103.                             else
  104.                             {
  105.                                 if (! empty($this->debug)) echo 'auth failed';
  106.  
  107.                                 return false;
  108.                             }
  109.                         }
  110.                     break;
  111.                 }
  112.             }
  113.         }
  114.  
  115.     }
  116.  
  117.     //Collects the raw data containing the email addresses
  118.     function rx_data()
  119.     {
  120.         $this->_put("SYN $this->trID 0\r\n");
  121.  
  122.         //Supplies the second MSG code which stops
  123.         //the script from hanging as it waits for
  124.         //more content
  125.         $this->_put("CHG $this->trID NLN\r\n");
  126.  
  127.         $stream_info = stream_get_meta_data($this->fp);
  128.         $email_total = 100;
  129.         //the count check prevents the script hanging as it waits for more content
  130.         while ((! feof($this->fp)) && (! $stream_info['timed_out']) && ($this->count <= 1) && (count($this->email_input) < $email_total))
  131.         {
  132.             $data = $this->_get();
  133.             $stream_info = stream_get_meta_data($this->fp);
  134.  
  135.             if ($data)
  136.             {
  137.  
  138.                 switch($code = substr($data, 0, 3))
  139.                 {
  140.                     default:
  141.                         // uncommenting this line here would probably give a load of "error code not found" messages.
  142.                         //echo $this->_get_error($code);
  143.                     break;
  144.                     case 'MSG':
  145.                        //This prevents the script hanging as it waits for more content
  146.                        $this->count++;
  147.                     break;
  148.                     case 'LST':
  149.                        //These are the email addresses
  150.                        //They need to be collected in email_input
  151.  
  152.                        $this->email_input[] = $data;
  153.                        if ($this->debug) print("<span class='b'>" . count($this->email_input) . "</span>");
  154.  
  155.                     break;
  156.                     case 'SYN':
  157.                     $syn_explode = explode(" ", $data);
  158.                     $email_total = $syn_explode[3];
  159.                     break;
  160.                     case 'CHL':
  161.                         $bits = explode (' ', trim($data));
  162.  
  163.                         $return = md5($bits[2].'Q1P7W2E4J9R8U3S5');
  164.                         $this->_put("QRY $this->trID msmsgs@msnmsgr.com 32\r\n$return");
  165.                     break;
  166.  
  167.                 }
  168.             }
  169.         }
  170.  
  171.     }
  172.  
  173.     //This function extracts the emails and screen names from the raw data 
  174.     //collected by rx_data
  175.     function process_emails () {
  176.  
  177.       //Neaten up the emails
  178.  
  179.       //$regex = "|^LST\s(\S+?)\s(\S+?)\s\d+?\s\d+?$|";
  180.       foreach($this->email_input as $email_entry) {
  181.  
  182.         //Seperate out the email from the name and other data
  183.         $this->email_processing[] = explode(" ", $email_entry);
  184.  
  185.       }
  186.  
  187.       //Get rid of the unnecessary data and clean up the name
  188.       foreach($this->email_processing as $email_entry){
  189.  
  190.         $this->email_output[] = array(0 => $email_entry['1'],
  191.                                         1 => urldecode($email_entry[2]));
  192.     }
  193.  
  194.     //var_dump($this->email_processing);
  195.     //var_dump($this->email_output);
  196.  
  197.  
  198.  
  199.   }
  200.  
  201.     //This is a quick way of calling all the seperate functions
  202.     //needed to grab the contact list
  203.     function getAddressbook($username, $password) {
  204.  
  205.       //Connect to the MSNM service
  206.       $this->connect($username, $password);
  207.  
  208.       //Get data
  209.       $this->rx_data();
  210.  
  211.       //Process emails
  212.       $this->process_emails();
  213.  
  214.       //send the email array
  215.       return $this->email_output;
  216.  
  217.  
  218.     }
  219.  
  220.  
  221.     /*====================================*\
  222.         Various private functions
  223.     \*====================================*/
  224.  
  225.     function _ssl_auth($auth_string)
  226.     {
  227.         if (empty($this->ssh_login))
  228.         {
  229.             if ($this->curl_bin)
  230.             {
  231.                 exec("$this->curl -m 60 -LkI $this->nexus", $header);
  232.                 $header = implode($header, null);
  233.             }
  234.             else
  235.             {
  236.                 $ch = curl_init($this->nexus);
  237.  
  238.                 curl_setopt($ch, CURLOPT_HEADER, 1);
  239.                 curl_setopt($ch, CURLOPT_NOBODY, 1);
  240.                 curl_setopt($ch, CURLOPT_FOLLOWLOCATION, 1);
  241.                 curl_setopt($ch, CURLOPT_SSL_VERIFYPEER, 0);
  242.                 curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1);
  243.                 // curl_setopt($ch, CURLOPT_TIMEOUT, 2);
  244.  
  245.                 $header = curl_exec($ch);
  246.  
  247.                 curl_close($ch);
  248.             }
  249.  
  250.             preg_match ('/DALogin=(.*?),/', $header, $out);
  251.  
  252.             if (isset($out[1]))
  253.             {
  254.                 $slogin = $out[1];
  255.             }
  256.             else
  257.             {
  258.                 return false;
  259.             }
  260.         }
  261.         else
  262.         {
  263.             $slogin = $this->ssh_login;
  264.         }
  265.  
  266.  
  267.         if ($this->curl_bin)
  268.         {
  269.             $header1 = '"Authorization: Passport1.4 OrgVerb=GET,OrgURL=http%3A%2F%2Fmessenger%2Emsn%2Ecom,sign-in='.$this->passport.',pwd='.$this->password.','.$auth_string.'"';
  270.  
  271.             exec("$this->curl -m 60 -LkI -H $header1 https://$slogin", $auth_string);
  272.  
  273.             $header = null;
  274.  
  275.             foreach ($auth_string as $key => $value)
  276.             {
  277.                 if (strstr($value, 'Unauthorized'))
  278.                 {
  279.                     echo 'Unauthorised';
  280.                     return false;
  281.                 }
  282.                 elseif (strstr($value, 'Authentication-Info'))
  283.                 {
  284.                     $header = $value;
  285.                 }
  286.             }
  287.         }
  288.         else
  289.         {
  290.             $ch = curl_init('https://'.$slogin);
  291.             curl_setopt($ch, CURLOPT_HTTPHEADER, array(
  292.                             'Authorization: Passport1.4 OrgVerb=GET,OrgURL=http%3A%2F%2Fmessenger%2Emsn%2Ecom,sign-in='.$this->passport.',pwd='.$this->password.','.$auth_string,
  293.                             'Host: login.passport.com'
  294.                             ));
  295.  
  296.             curl_setopt($ch, CURLOPT_HEADER, 1);
  297.             curl_setopt($ch, CURLOPT_NOBODY, 1);
  298.             curl_setopt($ch, CURLOPT_FOLLOWLOCATION, 1);
  299.             curl_setopt($ch, CURLOPT_SSL_VERIFYPEER, 0);
  300.             curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1);
  301.             // curl_setopt($ch, CURLOPT_TIMEOUT, 2);
  302.  
  303.             $header = curl_exec($ch);
  304.  
  305.             curl_close($ch);
  306.         }
  307.  
  308.         preg_match ("/from-PP='(.*?)'/", $header, $out);
  309.  
  310.         return (isset($out[1])) ? $out[1] : false;
  311.     }
  312.  
  313.  
  314.     function _get()
  315.     {
  316.         if ($data = @fgets($this->fp, 4096))
  317.         {
  318.  
  319.  
  320.             if ($this->debug) echo "<div class=\"r\">&lt;&lt;&lt; $data</div>\n";
  321.  
  322.             return $data;
  323.         }
  324.         else
  325.         {
  326.             return false;
  327.         }
  328.     }
  329.  
  330.  
  331.     function _put($data)
  332.     {
  333.         fwrite($this->fp, $data);
  334.  
  335.         $this->trID++;
  336.  
  337.         if ($this->debug) echo "<div class=\"g\">&gt;&gt;&gt; $data</div>";
  338.     }
  339.  
  340.  
  341.     function _get_error($code)
  342.     {
  343.         switch ($code)
  344.         {
  345.             case 201:
  346.                 return 'Error: 201 Invalid parameter';
  347.             break;
  348.             case 217:
  349.                 return 'Error: 217 Principal not on-line';
  350.             break;
  351.             case 500:
  352.                 return 'Error: 500 Internal server error';
  353.             break;
  354.             case 540:
  355.                 return 'Error: 540 Challenge response failed';
  356.             break;
  357.             case 601:
  358.                 return 'Error: 601 Server is unavailable';
  359.             break;
  360.             case 710:
  361.                 return 'Error: 710 Bad CVR parameters sent';
  362.             break;
  363.             case 713:
  364.                 return 'Error: 713 Calling too rapidly';
  365.             break;
  366.             case 731:
  367.                 return 'Error: 731 Not expected';
  368.             break;
  369.             case 800:
  370.                 return 'Error: 800 Changing too rapidly';
  371.             break;
  372.             case 910:
  373.             case 921:
  374.                 return 'Error: 910/921 Server too busy';
  375.             break;
  376.             case 911:
  377.                 return 'Error: 911 Authentication failed';
  378.             break;
  379.             case 923:
  380.                 return 'Error: 923 Kids Passport without parental consent';
  381.             break;
  382.             case 928:
  383.                 return 'Error: 928 Bad ticket';
  384.             break;
  385.             default:
  386.                 return 'Error code '.$code.' not found';
  387.             break;
  388.         }
  389.     }
  390. }
  391. ?>
  392.  
  393.  
and index file is:

Expand|Select|Wrap|Line Numbers
  1. <?php
  2.  
  3.  
  4.     ob_start();
  5.     set_time_limit(0);
  6.     $dir = 'csvUpload';
  7.     $dp = opendir($dir) or die ('Fatal Error: ');
  8.     while ($file = readdir($dp)) 
  9.     {
  10.         if ((eregi('.csv',$file)) && (filemtime($dir."/".$file)) < (strtotime('yesterday'))) 
  11.         {
  12.             $del=@unlink($dir."/".$file);
  13.         }
  14.     }
  15.     if(isset($_POST['domain']) && !empty($_POST['domain']))
  16.     {
  17.         $usrdomain     = $_POST['domain'];
  18.     }
  19.     ?>
  20.     <html>
  21.     <head>
  22.     <title>Contact Grabber</title>
  23.     <style>
  24.     body,td,div,select,a
  25.     {
  26.         #font-family:arial,sans-serif;
  27.         #font-size:13px;
  28.  
  29.         font-family:Verdana, Arial, Helvetica, sans-serif;
  30.         font-size:13px;
  31.         color:#765E1B;
  32.         #padding:35px 50px 0px 50px ;
  33.     }
  34.     .style1 {color: #0000FF}
  35.     .style3 {color: #0000FF; font-weight: bold; }
  36.     .style4 {color: #FF0000}
  37.     </style>
  38.     <script language="javascript">
  39.     function checkEmpty(frm)
  40.     {
  41.         if (frm.username.value == "" || frm.password.value == "")
  42.         {
  43.             alert("Please enter username & password.");
  44.             frm.username.focus();
  45.             return false;
  46.         }
  47.         return true;
  48.     }
  49.     </script>
  50. <script type="text/javascript">
  51.     function checkUncheckAll(theElement)
  52.      {
  53.      var theForm = theElement.form, z = 0;
  54.      for(z=0; z<theForm.length;z++)
  55.      {
  56.       if(theForm[z].type == 'checkbox' && theForm[z].name != 'checkall')
  57.       {
  58.       theForm[z].checked = theElement.checked;
  59.       }
  60.      }
  61.     }  
  62. </script>
  63.  
  64.     </head>
  65.     <body onLoad="document.loginForm.username.focus();">
  66.     <form action="index.php" method="POST" onSubmit="return checkEmpty(this);" name="loginForm">
  67.     <table width="490" border="0" align="center" cellpadding="2" cellspacing="0" bordercolor="#0000FF" bgcolor="#42AACC">
  68.       <tr>
  69.           <td width="117"><div align="center"><span class="style3">Username</span></></div></td>
  70.           <td width="174"><input type="text" name="username" value="<?php echo @$_POST['username']; ?>" size="29" /></td>
  71.         <td width="187">    
  72.           <select name="domain" size="1">
  73.             <option value="gmail.com" <?php if ($usrdomain=="gmail.com") echo selected; ?>>@gmail.com</option>
  74.             <option value="live.com" <?php if ($usrdomain=="live.com") echo selected; ?>>@live.com</option>
  75.             <option value="rediffmail.com" <?php if ($usrdomain=="rediffmail.com") echo selected; ?>>@rediffmail.com</option>        
  76.             <option value="yahoo.com" <?php if ($usrdomain=="yahoo.com") echo selected; ?>>@yahoo.com</option>
  77.           </select>        </td>
  78.       </tr>
  79.       <tr>
  80.             <td class="style3">Password</td>
  81.           <td colspan="2"><input name="password" type="password" class="style3" size="25"/></td>
  82.       </tr>
  83.       <tr>
  84.           <td align="center"><span class="style1"></span></div></td>
  85.         <td align="center"><input name="submit" type="submit" class="style3" value="Fetch My Contacts" /></td>
  86.         <td align="center">&nbsp;</td>
  87.       </tr>    
  88.     </table>
  89.     </form>
  90.     </body>
  91.     </html>
  92.  
  93.     <?php
  94.     if(isset($_POST['submit']) && !empty($_POST['submit'])) 
  95.     {
  96.         if(!extension_loaded(curl))
  97.         {
  98.             die('<p align="center"><font color="#FF0000">Curl is not installed on your server, Please contact to your server administrator.</font></p>');
  99.         }    
  100.  
  101.         $YOUR_EMAIL         = $_POST['username'];
  102.         $YOUR_PASSWORD      = $_POST['password'];
  103.  
  104.         require("baseclass/baseclass.php");
  105.         if($usrdomain=="rediffmail.com")
  106.         {
  107.              require("rediff/grabRediff.class.php");
  108.              $YOUR_EMAIL = $_POST['username']."@".$usrdomain;
  109.              $obj = new rediff();
  110.              //echo $YOUR_EMAIL;
  111.         }
  112.  
  113.         if($usrdomain=="gmail.com")
  114.         {
  115.              require("gmail/libgmailer.php");
  116.              $YOUR_EMAIL = $_POST['username']."@".$usrdomain;
  117.              $obj = new GMailer();
  118.         }
  119.  
  120.         if($usrdomain=="yahoo.com")
  121.         {
  122.             require("yahoo/class.GrabYahoo.php");
  123.              $obj = new GrabYahoo();
  124.             //echo $_POST['username'].$usrdomain;    
  125.         }
  126.  
  127.         if($usrdomain=="live.com")
  128.         {
  129.         $YOUR_EMAIL = $_POST['username']."@".$usrdomain;
  130.         //$obj = new msn;
  131.         //$returned_emails = $obj->getAddressbook($YOUR_EMAIL, $_POST['password']);
  132.         //echo $_POST['username']."@".$usrdomain;
  133.         if((isset($_POST['username'])) && (isset($_POST['password'])))
  134.              {
  135.             require("hotmail/msn_contact_grab.class.php");
  136.             $msn2 = new msn;
  137.             $returned_emails = $msn2->getAddressbook($YOUR_EMAIL, $_POST['password']);
  138.                 echo "<table border='1' bordercolor='#0000FF' align='center' ><tr><td align='center'><input type='checkbox' onclick='checkUncheckAll(this)' ><b>Select/Deselect</b></td><td align='center'><b>Name</b></td><td align='center'><b>Email Address</b></td></tr>";
  139.                 foreach($returned_emails as $row)
  140.                 {
  141.                   //echo "<tr><td>".$row['0']."</td><td>".$row['1']."</td></tr>";
  142.                 echo "<tr><td>"."<input type='checkbox' name='chk' value='chk' >"."</td><td style='Font-Family:verdana;Font-Size:14'>".$row['1']."</td><td style='Font-Family:verdana;Font-Size:14'>".$row['0']."</td></tr>";
  143.                 };
  144.                 echo "</table>";
  145.             }
  146.         }
  147.         else 
  148.         {
  149.             $contacts = $obj->getAddressbook($YOUR_EMAIL,$YOUR_PASSWORD);
  150.         }
  151.         $fp = fopen("cookie.txt","w+");
  152.         fwrite($fp,"");                
  153.         fclose($fp);
  154.          if(!is_array($contacts))
  155.          {
  156.              die('<p align="center"><font color="#FF0000">No contacts found</font></p>');
  157.          }
  158.          $str="";
  159.         if(is_array($contacts))
  160.         {
  161.             $totalRecords=0;
  162.             $actualfile = $YOUR_EMAIL.time().".csv";
  163.             $fileName="csvUpload/".$actualfile;
  164.  
  165.             $handler= fopen($fileName,"a");
  166.             fwrite($handler,"NAME".","."EMAIL"."\n");
  167.  
  168.             $total = sizeof($contacts['name']);
  169.  
  170.             //print the addressbook 
  171.             $str.= "<table border='1' bordercolor='#0000FF' align='center' ><tr><td align='center'><input type='checkbox' onclick='checkUncheckAll(this)' ><b>Select/Deselect</b></td><td align='center'><b>Name</b></td><td align='center'><b>Email Address</b></td></tr>";
  172.             for ($i=0;$i< $total;$i++) 
  173.             {
  174.                 $totalRecords = $totalRecords+1;
  175.                 $rep           = array("<br>","&nbsp;");
  176.  
  177.                 $str.="<tr><td>"."<input type='checkbox' name='chk' value='chk' >"."</td><td style='Font-Family:verdana;Font-Size:14'>".$contacts['name'][$i]."</td><td style='Font-Family:verdana;Font-Size:14'>".$contacts['email'][$i]."</td></tr>";
  178.                 $contacts['email'][$i] = str_replace($rep, "",$contacts['email'][$i]);
  179.                 $contacts['name'][$i]  = str_replace($rep, "",$contacts['name'][$i]);
  180.                 fwrite($handler,$contacts['name'][$i].",".$contacts['email'][$i]."\n");
  181.             }
  182.             $str.= "</table>";
  183.             fclose($handler);
  184.         }
  185.  
  186.         echo "<p align='center'><a href='header.php?filename=$actualfile'><font color='blue'>Save contacts as a CSV file</font></a>&nbsp;&nbsp; You have total <font color='blue'>$totalRecords</font> contacts</p>";
  187.         echo '<form>';
  188.         echo $str;    
  189.         echo '<br />';
  190.         echo '<p align="center"><input type="submit" name="submit" value="Send Invitation" /></p>';    
  191.         echo '</form>';        
  192. }
  193. ?>
  194.  
  195.  
for gmail yahoo and rediff its working but i have a problem in hotmail file...

thanx

tokcy
Dec 12 '08 #4

acoder
Expert Mod 15k+
P: 16,027
Does this have anything to do with the original question?
Dec 13 '08 #5

Post your reply

Sign in to post your reply or Sign up for a free account.