Wednesday, September 23, 2009

First time PHP have the 3rd position in the programming languages.

PHP programming language has been listed among the first 3 most popular and widly used computer programming languages in the world. According to TIOBE Programming Community Index, PHP is 3 position first time .


First position is Java , second position is C and third position is PHP.



The complete graph of the PHP from 2004 to present of TIOBE community.



In the year 2008 PHP position is 5th now increases the two positions and now is 3rd position.


Thank you.


Anil Kumar Panigrahi

Wednesday, September 16, 2009

Static HTML page as email body using PHP

The following code will work, this functionality is use the external html content as email body.



$mail = new PHPMailer();

$mail->IsMail();


$mail->Timeout = 360;

$mail->From = “”;

$mail->FromName = “”;

$mail->AddReplyTo(”");

$mail->AddAddress($Email);


$mail->IsHTML(true);

$mail->Subject = “Html as email”;


$file = fopen(”email.html”,”r”);

$str=fread($file,filesize(”email.html”));


$str = trim($str);

fclose($file);


$mail->Body = $str;


$mail->Send();


Then it will send the external html file as email body.


But be sure that in the html file all images should be full path. like:

http://www.domain.com/images/<image name>



It will be helpful.


Thank you,

Monday, September 14, 2009

Father of PHP - Rasmus Lerdorf


Rasmus Lerdorf is created PHP at that time PHP stands for "Personal Home Page". It was later changed to "Hypertext Preprocessor" by Suraaski and Gutmans during the rewrite to PHP3 as it's use extended beyond html page manipulation.

Tuesday, September 8, 2009

Using PHP code to get the current page URL?

the following function will get the current page URL using php code:

<?php

function currentPageURL() {

$curpageURL = ‘http’;


if ($_SERVER["HTTPS"] == “on”) {$curpageURL.= “s”;}

$curpageURL.= “://”;

if ($_SERVER["SERVER_PORT"] != “80″) {

$curpageURL.= $_SERVER["SERVER_NAME"].”:”.$_SERVER["SERVER_PORT"].$_SERVER["REQUEST_URI"];


} else {

$curpageURL.= $_SERVER["SERVER_NAME"].$_SERVER["REQUEST_URI"];

}

return $curpageURL;

}


echo currentPageURL();

?>

Friday, September 4, 2009

How to create a Website

About how to create and install a website.

Creating a Website:

may seem like something quite simple at first, then you research a little more and quickly become baffled by terminology and technology alike.

The thing is that whenever you try to search for something relative to web design


it is generally written by a computer whiz kid who expects you to understand the lingo as fluently as he does.

I recognize that this is not usually the case so I have gathered up the relevant information and used my own personal expertise to help you understand the process a little easier.

The Basics

When building a website, there are several things you will need. It is important to understand exactly what these things are so as not to confuse yourself further.

Domain name

This is your website address; people will type this into their browser when they want to navigate to your site. It starts with www.

By now you will probably struggle to find one that you think is perfect because there are so many websites out there. The internet is far from a new technology and you may have to settle for your second best option. Don’t over complicate the domain name though because it has to be something memorable and easy to spell.

You may be able to pick up a domain name very cheaply or even free, do remember though that you will have to pay for the domain to be registered.

Try to keep it localized, for instance if you only operate in the UK then a .com domain may not be necessary and those domains are usually very expensive.

Hosting

This is where your domain name ‘lives’ and without it you wouldn’t have a site. Think of it as buying a filing cabinet for your office. The host stores all of your internet files and folders and you pay them an annual fee. Again you may be able to find a hosting package for free if you don’t require masses of space, however; they may not provide additional services and the customer service level will undoubtedly be poor.

If you decide to go with a free host bear in mind that you probably won’t get email accounts and as such you are complicating matters further!~

Website builder

Assuming you don’t know HTML, CSS, PHP, XML or any other of the delights involved with web design you will need a website builder.

If you have paid for your hosting you will see the benefits now because your host will more than likely provide you with an online builder that will automatically publish your website as and when you tell it to.

If you haven’t paid for your hosting or for whatever reason your host isn’t nice enough to provide a website builder then my personal recommendation is WYSIWYG.













Once you have had a look around the interface it really is very simple to use. The above image is a particularly old version of WYSIWIG and there are now versions available that are even easier to use. You don’t need any programming or HTML knowledge and it is very user friendly.

There are several options available as standard for instance a form wizard that enables you to put contact forms into your website without any PHP knowledge.

If you want your site to have advanced features such a login pages and registration etc then WYSIWIG is not for you and you will need to pay a designer, unless you fancy learning PHP and creating a MySQL database.

FTP Client

If you are using WYSIWIG then you won’t need an FTP client unless you make a mistake that you’ve published. If your website builder doesn’t have a publish feature or you’ve been brave and had a go at creating your own HTML then you will need an FTP.

This is an interface where you basically drag and drop the files into the public_html file or your root directory. This might sound mind boggling but I assure you the files are clearly titled so it isn’t an issue.

You will need the details of your host’s server, your login details and the file to upload to (root directory). Once the connection has been established all that remains is to upload the files and your site is ready!

Remember to name your homepage index.html or index.htm all in lowercase! You might think that such an insignificant issue wouldn’t cause many problems but it really does!

Here is a free FTP client:

http://filezilla-project.org/

Common Problems

When I go to my site all I see is a list of folders in my index, what’s wrong?

You need an FTP client, you will need to rename your homepage as index.html and don’t look at me that way trust me when I say its name is wrong. It has probably saved itself as something stupid such as index.html.html.

When I try to send off a dummy form through my site nothing happens?

The PHP coding is outside of the form area. You need to create a bigger form area around the entry fields.

When I go to a page on my site it says Error?

The page is either named wrong or it is a PHP page that hasn’t been updated and still remains as .html.

Your host’s server may be down or the page is saved in the wrong file directory, again you will need to check that it is in the root directory or public_html.

When I go to my site it says “the owner hasn’t uploaded any files yet” or something similar.

You haven’t published your files correctly. Make sure you have entered the correct parameters in the FTP client.

Original article from http://webupon.com/web-design/how-to-create-a-website-2/


Thursday, September 3, 2009

To set the pagination in CodeIgniter

See the code below: to set the pagination in CodeIgniter

In the controller: add the below code

$this->load->library(’pagination’);
$config['total_rows'] = $this->db->count_all(’code_image’);
$config['per_page'] = ‘3′;
$config['full_tag_open'] = ‘

’;
$config['full_tag_close'] = ‘

’;
$config['base_url'] = base_url().’upload/list_images/’;

$this->pagination->initialize($config);
//echo base_url();
$this->load->model(’code_image’);
$data['images'] = $this->code_image->get_images($config['per_page'],$this->uri->segment(3));

In the View: add the below code


pagination->create_links(); ?>


It will only display the 3 images per page.

To Configure the baseurl in CodeIgniter?

See the code:

In the application\config\ in that folder we have list of files., in that we have to modify the file is config.php


$config['base_url'] = “http://localhost/CodeIgniter/”;


and helpers :

appication \ config\ autoload.php file we have to modify.


$autoload['libraries'] = array();
to
$autoload['libraries'] = array(’database’, ’session’);

$autoload['helper'] = array(’form’, ‘url’);

Most Cutest Plumber

The most cutest plumber: