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();

?>