Hello World Program in Codeigniter Framework in PHP

Hello World Program in Codeigniter

Here, I will show how to write programming in Codeigniter step by step.

Step 1: Download Codeigniter framework from “http://ellislab.com/codeigniter/download” and extract it to “C:/xampp/htdocs/” and named it into “Demo”. Then open Browser URL and type “http://localhost/Demo” you will get like following:

image1.jpg

Step 2: Open Notepad or any editor and write following program

<?php
class HelloWorld extends CI_Controller
{
function index()
{
echo “Hello Wolld”;
}
}
?>

After writing the above program save it to “C: /xammp/htdocs/Demo/application/controllers” as “HelloWorld.php”. And now type “http://localhost/Demo/index.php/HelloWorld” you will get output as “Hello World” like following.

image2.jpg

Ebook Download
View all
Learn
View all