Saturday, October 9, 2010

Family Online På Iphone

Sending Email in PHP Using function mail ( )

PHP provides scripts that can be used to send email. The function used is the mail (). Here's how to use it:
mail ("hanjesagitsna_828@yahoo.com", "This Subject", "This loh message ")

first parameter is the email destination, the second parameter is the subject, and the third parameter is the contents of emails. To use the function mail () on localhost, should slightly alter the php.ini file located in xampp \\ apache \\ bin . Open the file in notepad, search (ctrl + f) the words "[mail function]" (without the quotes), below that line is SMTP, smtp_port and sendmail_from.

SMTP with smtp of Contents your current Internet, eg mail.fast.net.id for smtp FastNet. Sedangkah smtp_port filled with 25, and sendmail_from filled with the sender's email.

Example on file php.ini on my computer as follows:
[mail function]
; For Win32 only.
SMTP = mail.fast.net.id
; SMTP = telkom.net.id
smtp_port = 25
; For Win32 only.
sendmail_from = hikarianna1@yahoo.com

After making changes in php.ini file, save the new data, and try using the function mail ().

If the website has been in the hosting, the php.ini file is not needed anymore, because already in the hosting. The bottom line php.ini file does not need to be considered again.

Wednesday, October 6, 2010

How Long Does It Take A Malignant Mole To Spread

Google Pagerank in PHP Script

Lately, I am very confused to find how to get the PageRank of a website. At first, I thought that Google provides a web service so I can use. Apparently not.

Finally I find out on the internet, and found a script that can help me. Here is a function to get the pagerank that are made in the form of function:
function PageRank ($ url) {
if (function_exists ('curl_init')) {$ ch = curl_init
();
curl_setopt ($ ch, CURLOPT_URL, 'http://api.fusionswift.com/pagerank/?url =' . $ Url);
curl_setopt ($ ch, CURLOPT_HEADER, 0);
curl_setopt ($ ch, CURLOPT_RETURNTRANSFER, 1);
$ googleurl = curl_exec ($ ch);
curl_setopt ($ ch, CURLOPT_URL, $ googleurl);
$ out = curl_exec ($ ch);
curl_close ($ ch);} else {

$ googleurl = file_get_contents ('http://api.fusionswift.com/pagerank/?url ='. $ url);
$ out = file_get_contents ($ googleurl);
}
$ pieces = explode (':', $ out);
$ pr = $ pieces [2];
return trim ($ pr);
}
To call the function can be used The following script:
$ Url = "http://hikarianna.blogspot.com/";
echo "PageRank from". $ Url. "Is =". PageRank ($ url);
following script can be downloaded HERE .

Source:
http://fusionswift.com/blog/2010/04/google-pagerank-script-in-php/