inicio mail me! View Ehsanul Haque's LinkedIn profile sindicaci;ón

Archive for May, 2006

WeberForums.com Moderator

On 25th May, 2006 finally my account with WeberForums.com was set as Moderator. WeberForums.com is the forum support side for WeberDev.com, Weber Sites Ltd. I was asked to give Berber (Administrator) a list of forums that I would like to Moderate. I have chosen the following:

1. PHP General
2. PHP Articles Tutorials and Scripts
3. MySQL General
4. Apache General
5. Java Script
6. HTML

I hope to contribute to the forums on regular basis and help other users to solve their problems. I’m really happy to be a part of WeberForums.com as a moderator.

I do not like to talk about my dreams, goals and targets that I have set for myself. But I will keep posting of them when achieved. This is one of them.

~~ThAnKs~~

Grab Yahoo Class on phpclasses.org

Today my class titled Grab Yahoo has been published on www.phpclasses.org.

This class is a collation of my previous two scripts in PHP to grab Yahoo address book and messenger list. You will have to provide your
Yahoo account username and password to it which will return an array of the list of your choosen service (Address Book or Messenger List).

This will be useful in a way that anyone willing to provide the service like upon user registration to the site, you ask the person to invite people on their Yahoo address book etc. Similar to what Hi5, Name Database etc does.

Please visit the download page here to download the class pack.

Visit the discussion board to post any suggestion, comment or bug to report.

Please don’t forget to rate my script.

Visit this page to see the demo.
~~Thanks to all and God Bless!!~~

My Own iPod Nano

Yesterday I received my own iPod Nano. This is an awsome toy. Real small and thin.

With 1 GB memory and the nice feature it has, one cannot complain of anything else. When I opened the well organised box, I was really surprised to see the size of it. It came with a velvet cover, headphones and software required, iTunes etc. Oh two Apply stickers!!

Thanks to Lisa Skinner for the nice gift she sent for the small work that I have done on her e-commerce site. I simply love the toy and having nice time listening to my favorite songs.

~~CoOl~~

Update for Y!MFL to run on Localhost

First of all Thanks to Mr Arun for pointing out the problem in running the script (Yahoo! Messenger Friend List) on localhost. When I started working with cURL to grab the Yahoo address book, I faced the problem. Later when I uploaded my script on to server, it did not give any error and since then I have been testing my code there instead of testing it locally. But due to the fact that people will definitely try to run it on their localhost, I came to realisation that it is necessary to provide a solution. So after few hours of investigation I finally resolved it.

Basically the problem is that cURL is unable to verify the SSL certificate on localhost. The error that is generated by cURL is:

SSL certificate problem, verify that the CA cert is OK. Details: error:14090086:SSL routines:SSL3_GET_SERVER_CERTIFICATE:certificate verify failed

If you print the cURL error in my code, you will see this error generated on localhost.

echo curl_error($ch);

To solve this problem, first we will need to provide a file that is known as CA Bundle for cURL to read and verify the SSL certificate. Download the text format file for CA Bundle from here. On the site it says the file is in PEM format, but on my WinXP I saved the file as “CRT” file. This extension shows the correct icon. Although the extension really does not matter because all cURL will use it for is to verify the SSL certificate.

This is not the only problem that I faced while working on localhost. I found the cURL option CURLOPT_COOKIEJAR does not save the cookie file. I found a nice explanation of it on php.net. There were few options that was given by users. One of them was that after a cookie is created the cookie information reside in the header. When CURLOPT_COOKIEJAR cannot write it to a file you can write the header information using CURLOPT_WRITEHEADER to a file and grab the cookie information from there. But one of the other option solved the problem very easily. Relative path to the file that I specified was not understood by cURL. So instead I had to write full path for the filename which worked perfectly. cURL option CURLOPT_COOKIEJAR wrote the file without any problem.

The last problem that I faced was a little tricky and took most of my time solving it. I was getting authenticated by Yahoo without any problem but when I was trying to go to next step, which is actually to grab my messenger list a cURL error was generated “Can’t connect to host”. I could not understand why one part of the code connects to Yahoo and authenticates and the other cannot connect to any site at all. This was probably due to my tired brain which took this much time figuring out the problem. The problem is that I use HTTP proxy server!! But do not require any proxy to connect to secured servers. Solution to this is to use cURL option CURLOPT_PROXY to specify your proxy server address and port number, only if you require proxy server. According to my code, it should be placed in the second part of cURL operation, which is initalised to $ch1.

curl_setopt($ch1, CURLOPT_PROXY, “proxy.address_of.isp:port”);

This small changes resolves all problems and the script works on localhost perfectly. Here is a quick look towards the change required in get_list.php file.

Step 1: Download the CA Bundle file and place it where your server can access. Make sure the file and directory has the right permission setup.

Step 2: Place the following line before performing the first cURL session, i.e. curl_exec($ch); [line number 64]

curl_setopt($ch, CURLOPT_CAINFO, ‘full/path/to/the/ca-bundle.crt’);

Step 3: You need to specify the full path to save your Cookie file. Currently line number 53 needs to be modified.

$cookieFilename = MD5($cookieFilename);

changes to

$cookieFilename = $_SERVER['DOCUMENT_ROOT'] . ‘/any/additional/directory/names/’ . MD5($cookieFilename);

I prefer to use DOCUMENT_ROOT, but the path should be as per your choice and must be accessible by your server.

Step 4: This step is to be followed only if you are using proxy server. Specify the following line before performing your cURL session. If you require proxy for both http and secured server then the lines should be used in the both sessions.

curl_setopt([$ch][$ch1], CURLOPT_PROXY, “proxy.address_of.isp:port”);

After solving this to run on localhost, I am now interested to make the code more customisable. Use of constants, methods etc will be very nice. I also need to clean up the code a lot. Please contact me if anyone of you face problem using it either on localhost or remote server.

~~ThAnKs~~

Yahoo! Services with PHP cURL

Using cURL in PHP is not that tough after all. Just the other day I came up with a script that grabs the Yahoo! Address Book. Today I have modified the same script to grab Yahoo! Messenger friend list.

Check out grabbers here.

One must know the URLs that Yahoo! goes through and data that it passes for authentication. After cURL helps you to authenticate on Yahoo, you simply write a Cookie file to contain the session information. This file is used later part of the script where cURL helps you to grab the address book or messenger list.

You will need to trick Yahoo by sending header information like HTTP Referrer. Address book is grabbed in CSV format, which needs to be parsed to show your desired information. There are 82 columns that address book sends you!! For messenger it is just cleaning up a HTML file generated by cURL. You instruct cURL not to give any output of the generated result, then save it on a temporary file, clean up unnecessary information, reformat the remaining information and print it on the screen. At the end you MUST use unlink() to delete all the files that were generated during the process. Cookie file, messenger list file etc. I have deleted them, being a good boy!!

Here is the partial sample code.

https://login.yahoo.com/config/login?”;
$ch = curl_init();
curl_setopt($ch, CURLOPT_USERAGENT, $useragent);
curl_setopt($ch, CURLOPT_URL, $url);
curl_setopt($ch, CURLOPT_POST, 22);
curl_setopt($ch, CURLOPT_POSTFIELDS, …..!!! STOP HERE

The script for grabbing Yahoo messenger list has been published on weberdev.com. Please click “Yahoo! Messenger Friend List” to see my code on weberdev.com and download the ZIP attached to the example.

~~EnJoY~~

Overlay Images with LightBox JS v2.0

Just found a nice JavaScript that helps you display any image overlayed on your current page. LightBox v2.0 (developed by Lokesh Dhakar) lets you click on a thumbnail image to show the bigger image with cool visual effect. It disables the parent window, shows a preloader while loading the image and then shows with a nice effect by resizing the area (in which image will be shown) to the image size.


Example of LightBox JS v2.0

The implementation process is very simple and works fine with both IE and FireFox. Download package comes with four JS files, one CSS and images you will need.

Here on my site, click on “enlarge image” link right below my name on top of the page to see my implementation of the JS. So far works nice. Need to test it with the other browsers though.

~~HaVe FuN~~

Registered Linux User!!

Recently registered myself to The Linux Counter. TLC provided me with a certificate and registration number.

Visit the site and register yourself if you are a linux user. You can place a link back to their site (as promotional act) on your personal site or blog. If you have your own Linux group, you can also register it with them. Check out the site for more information.

~~Cheers~~

UEStudio and Function List AGAIN!!

Just when I thought it is resolved, I found out the problem again!!! But this time it was certain files which were not showing my function list. I copied the content of one file (whose function list is not being shown) and pasted it onto a newly created file. It showed me the list all right.

Suddenly I remembered that my Unix/Mac file detection/conversion is “DISABLED”. I was not sure if it was the source of the problem, so I turned it on asking UE to prompt for action. I opened my locally created file, and it does not prompt for the conversion and opens fine. When I opened the naughty file, it prompted me for conversion and when I converted it to DOS format, UE happily showed me the function list. When I don’t convert it, UE does not like that and goes on to strike by not showing the function list.

The files not showing the function list were on my Linux server @ bdwebwork.com and so it requires a conversion when trying to open on Windows machine. I’ve now set my UE to auto convert the files to DOS mode, so that I don’t have to spend time clicking on OK button to do it. I’m too lazy for that.

UE Studio
> Advanced
> Configuration
> Load/Save/Conversions
> Unix/Mac file detection/conversion
> Automatically convert to DOS format

~!~

UEStudio/UltraEdit and Function List

I’ve been using UltraEdit for last couple of years and now recently upgraded to UEStudio. Suddenly I found out that the UEStudio is not listing out my functions in the current/active file. Been looking around the net for answer!! Found out the fix for it.

Right click on the empty function list window, and deselect the option “List for all project files“. You will find all your functions are now listed.

All Time Best Bangla Songs

BBC Bangla has recetnly announced The All Time 20 Best Bengali Songs.

BBC Bangla listeners nominated their 5 choices for the top list. Based on the nominations BBC Bangla created the top 20 list.

Visit the News page of BBC Bangla to listen to the songs. Here is the list of the 20 songs.

1. Amar Shonar Bangla
Author: Rabindra Nath Thakur

2. Manush Manush er Jonne
Original Author/Composer/Singer: Vupen Hazarika
Translated to Bengali by: Shibdash Benarjee

3. Amar Vai er Rokte Rangano Ekushe February
Singer: Abdul Gaffar Chowdhuri
Composer: Altaf Mahmud

4. Coffee House er Shei Adda ta aaj aar nei
Singer: Manna De
Author: Gouriproshonno Mazumdar
Composer: Shupornokanti Ghosh

5. Ek Shagor Rokte er Binimoye Banglar Shadhinota Anlo Zara
Composer: Apple Mahmud
Author: Gobindo Haldar

6. Ami Banglai Gaan Gai
Lyricist & Composer: Protul Mukharjee
Author: Mahmuduzzaman Babu

7. Mora Ekti Fulke Bachabo Bole Judhho Kori
Author: Gobindo Haldar
Composer & Singer: Apple Mahmud

8. Tumi Aaj Koto Dur
Singer: Jogonmoi Mitro
Author: Pranab Roy
Composer: Shubol Dash Gupta

9. Ek Nodi Rokto Periye
Author & Composer: Khan Ataur Rahman
Composer: Shahnaz Rahmatulla

10. Dhono Dhanno Pushpe Bhora
Author & Composer: Dijendhrolal Roy

11. Muse Jawa Din Gulo Amay Je Pisu Daake
Singer & Composer: Hemanta Mukharjee
Author: Gouriproshonno Mazumdar

12. Salam Salam Hazar Salam
Singer: Mohammad Abdul Zabbar
Author: Fazle Huda

13. Joy Bangla Banglar Joy
Author: Mazharul Anwar
Composer: Anwar Parvez

14. Khachar Bhitor Ochin Pakhi
Author: Lalon Shah
Singer: Farida Parvin

15. Ekbar Jete De Na Amar Sotto Shonar Gaaye
Singer: Shahnaz Rahmatullah
Author: Mazharul Anwar
Composer: Anwar Parvez

16. Karar Oi Louho Kopat
Author: Kazi Najrul Islam

17. Ai Padma Ai Meghna
Singer: Farida Parvin
Author & Composer: Abu Zafar

18. Chaal Chaal Chaal Urdhogogone Baaje Madol
Author: Kazi Najrul Islam

19. Ek Tara Tui Desher Kotha Bol
Singer: Shahnaz Rahmatullah
Author: Gazi Mazharul Anwar
Composer: Anwar Parvez


20. Tumi Ki Dekheso Kobhu Jiboner Porajoy
Singer: Mohammad Abdul Zabbar

Source: “Shorbo Kaaler Shorbo Sreshtho Bangla Gaan” BBCBengali.com 3rd May 2006 BBC Bangla http://www.bbc.co.uk/ben…..sheragaan.shtml

Among the list of 20 personally I like “Ami Banglai Gaan Gai”; ranked 6th in the list. No matter how many times I listen to the song, I never get bored of it. If I were to submit my favorite 5 songs, my list would have been:

1. Ami Banglai Gaan Gai
2. Coffee House er Shei Adda ta aaj aar nei
3. Muse Jawa Din Gulo Amay Je Pisu Daake
4. Bashi Shune Aar Kaaj Nai
(not in this list)
5. Manush Manush er Jonne

~~~EnJoY~~~

Next entries »