Kohana PHP Framework and CodeIgniter PHP Framework

Kohana PHP FrameworkCodeIgniter is a powerful PHP framework. I have been working on CodeIgniter for more than 2 years. I suggested lot of my friends to learn CodeIgniter. Few months back I started working on Kohana PHP framework. The slogan of Kohana is nice – “The Swift PHP Framework”. I liked Kohana at the first sight.

I developed several web application using Kohana and became a big fan of Kohana. Here I would like to show you some code segments of both frameworks. CodeIgniter

How to load view in CodeIgniter

To load a view in CodeIgniter you have to write

$this->load->view('home', $data);

How to load view in Kohana

$this->template->content = new View('home');

I like the Kohana’s technique best. CodeIngiter is not fully object oriented. Helper functions of CodeIgniter are not object oriented. But in Kohana, everything is object oriented. Say of example- here is a helper class and function to redirect to a particular function in Kohana.

url::redirect('some_controller/some_function');

But in CodeIgniter the helper function is something like this-

redirect(‘some_controller/some_function’);

I would like to share my opinion.

CodeIgniter:

  • Easy to learn
  • Fast and light weight
  • Good documentation
  • Not fully object oriented

Kohana:

  • Easy to learn
  • Fast and light weight
  • Documentation is not good
  • Fully object oriented

Validate HTML forms using jQuery – Ketchup

I was looking for a jQuery plugin to validate HTML forms. Today I was reading articles using Google Reader, and found a fantastic jQuery plugin to validate HTML forms shared by Hasin Hyder. Its simple, very flexible and extendable for its appearance and functionality.

More jQuery resources:

How to Fix NetBeans jdkhome error

I use NetBeans as the IDE both in Linux and Windows environment. I like this NetBeans IDE very much. In my Windows PC Java Runtime Environment was updated recently. I am getting following error message when I start NetBeans.

“Cannot find java.exe in specified jdkhome.”

NeatBeans jdkhome errorIf I click on yes it opens using default version of JRE. I fixed this error message today. Its a simple solution. Lets have a look into the solution.

1. Open NetBeans configuration file from NetBeans installation directory. (i.e. C:\Program Files\NetBeans 6.5\etc\netbeans.conf)

2. Set the configuration netbeans_jdkhome to the path of latest Java installed in your PC. (i.e. C:\Program Files\Java\jer1.6.6)

And you are done.

How to upgrade Ubuntu in command line

I was trying to upgrade Ubuntu in command line. I would like to share the commands in this post.

There are two simple commands to upgrade the version of Ubuntu distribution.

sudo apt-get update
sudo apt-get dist-upgrade

These commands perform smart update of Ubuntu.

What can we do with .htaccess files

Today I found a website regarding .htaccess tips and tricks. I learned a lot of .htaccess tips from that website. I would like to share the URL here.

.htaccess tips and tricks part 1

.htaccess tips and tricks part 2

This article was very helpful to me.

ডিসকানেক্ট সমস্যা, আমার অভিযোগ ও গ্রামীণফোনের কাস্টমার সার্ভিস

লেখার টাইটেলটা কিছুটা শিবরাম চক্রবর্তির গল্পের টাইটেলের মত মনে হতে পারে। গল্পই বটে, জীবন্ত গল্প। ঘটনাটি শুরু থেকেই বলি। তা নাহলে আবার বলবেন শুরুটাতো শুনলাম না।

২০০৮ সালের নভেম্বর মাস থেকে ইন্টারনেট লাইনের গতি এতই ধীর হয়ে গেল যে প্রতিদিনই মেজাজ গরম থাকতো। বউয়ের সাথেও মেজাজ খারাপ করতাম। কিছু দিন পরে পোস্ট পেইড সীম কিনলাম একটা। এবার কাস্টমার কেয়ারে ফোন করলাম। প্রিপেইড দিয়ে কাস্টমার কেয়ারে কথা বলে মজা নেই। খালি বুকের মধ্যে ধুক ধুক করে কখন ব্যালেন্স শেষ হয়ে যায়। পোস্ট পেইড দিয়ে অভিযোগ করতে থাকলাম দু দিন পর পর।

প্রতিদিন নতুন একজন কাস্টমার ম্যানেজারের সাথে কথা হয়। বলে- আপনার অভিযোগটি রাখছি, আশা করি শিঘ্রই ঠিক হয়ে যাবে। এক মাস পরে ইন্টারনেট লাইনের গতি আবার আগের মত হলো। ভালই স্পীড। ২০ কিলো বাইট থেকে ২৫ কিলো বাইট। কাস্টমার কেয়ার থেকে একজন ফোন করে জিজ্ঞেস করলো- স্যার আপনার ইন্টারনেট সমস্যা সমাধান হয়েছে? আমি বললাম, জী হয়েছে। লোকটার কাছে আরো জানতে পারলাম আমার এলাকার বিটিএস টাওয়ারে নাকি একটা নতুন ডিভাইস বসানো হয়েছে। তারই ফল সরূপ আমি ভালো স্পীড পাচ্ছি। আলহামদুলিল্লাহ।

ওমা, দুদিন পর থেকে দেখি আরেক সমস্যা। হঠাৎ হঠাৎ ইন্টারনেট ডিসকানেক্ট হয়ে যাচ্ছে। প্রথমে ভাবলাম আমার সেটের সমস্যা। আমার বন্ধুদের কয়েকটা সেট দিয়ে চেষ্টা করলাম। নাহ, সেটে সমস্যা না। কম্পিউটার এবং অপারেটিং সিসটেম পরিবর্তন করে দেখলাম। নাহ, সেটাও ঠিক আছে।

এবার স্থান পরিবর্তন করে দেখলাম। আমি থাকি গাজীপুরে। ঢাকায় ডিসকানেক্ট সমস্যা নেই। মোহাম্মাদপুরে, গুলশানে, যাত্রাবাড়ীতে কোনো সমস্যা নেই। নাখাল পাড়ায় ডিসকানেক্ট সমস্যা আছে। নাখাল পাড়ায় একদিন ৭/৮ ঘন্টার মত ছিলাম। Read the rest of this entry »

PHP Security Tips and Tools

Powerful Security

Powerful Security

I was reading on the topic “php security” using Google Reader. I hope it helps everyone to defining PHP security and it’s uses. Here I would like to quote some paragraphs from the original post on noupe.com

PHP is the most popular web programming languages in use today due in large part to the fact that it’s a highly flexible syntax that can perform many functions while working flawlessly in conjunction with html – Plus it’s relatively easy to learn for beginners, yet it’s powerful enough for advanced users as well. It also works exceptionally well with open source tools, such as the Apache web server and MySQL database. In other words, its versatility is unsurpassed when compared to other scripting languages, making it the language of choice for many programmers.

There are various types of attacks that PHP is particularly vulnerable to. The two main types of attacks are human attacks and automated attacks – Both of which can potentially devastate a website. The goal of PHP security is to minimize, and ultimately eliminate, the potential for both human and automated attacks by putting into place strategic lines of defense to eliminate access to your site by unverified users. The way you go about doing this is to target the most common types of PHP security breaches first, so that you make your website airtight against malicious attacks. So what are the most common types of PHP security breaches?

Most Common PHP Security Vulnerabilities

1. Register_Globals

Register_Globals makes writing PHP applications simple and convenient for the developer, but it also poses a potential security risk. This setting is located in PHP’s configuration file, which is php.ini, and it can be either turned on or off. When turned on, it allows unverified users to inject variables into an application to gain administrative access to your website. Most, if not all, PHP security experts recommend turning register_globals off. Read the rest of this entry »

Joomla error – Layout “unijoy” not found

I was getting a error message while trying to visit Joomla site in my local PC. I can visit the live joomla sites, but can not visit the Joomla site those are hosted in my local PC.

Following error message was generating:

Layout "unijoy" not found

I was trying to visit using Mozilla Firefox. If I use any other browser it shows everything fine. What was the problem?

I was facing this problem since several months. I could not mange time to identify the problem. Today I made a promise “I’ll fix this problem today”, and identified the problem and fixed.

Simply, there was a cookie in Firefox named layout and the value was “unijoy” for the localhost domain. When I try to visit Joomla site from my local PC, it picks the cookie “layout” and try to render the view “unijoy“.

I have remove the cookie and now it works fine. :D

7 things you may not know about me

The game I saw in Hasin Hayder‘s blog. I have been tagged by Rayhan Chowdhury yesterday. Thanks for the tagging.

“originally started by tony bibbs it is a funny thing indeed. okay, everyone knows what the seven things is. i was tagged by emran and here goes my seven things” – from Hasin Hayder‘s blog.

I like this game, and now let me share 7 things you may NOT know about me.

  1. I was a student of Humanities in SSC, HSC; and later I passed B.Ed. (Hons) and M.Ed. from Teachers Training College, Dhaka.
  2. In the last 4 years of my education, I was a hardware and trouble shooting engineer, based on home service.
  3. I have lots of students, youngest student read in class 8 (in 2003) and the oldest student is a doctor. I assume his age around 95 years.
  4. I wrote a book on computer learning named “এসো কম্পিউটার শিখি – Computer learning guide”, published by D.Net.
  5. Last month I got a baby girl who can not write PHP code. LOL…. I am sure her mother knows PHP and C++. Read the rest of this entry »

Dot bd (.bd) domain look up or whois look up

Dot bd (.bd), internet address of Bangladesh. Would you like to register .bd domain? You need to visit BTCL‘s office in Mogbazar, Dhaka. You may visit BTCL’s official website to know how to register .bd domain.

Here  I would like to share a simple service to search .bd domain for registration or whois record.

http://arafatbd.net/dotbd/

Visit this link to search .bd domain or whois record.

Cheers!

Posted in Domain. Tags: . 10 Comments »