Tuesday, January 13, 2009

mail attachment code, php

Hi All,
This is the simple mail attachment function.

function mail_attachment($filenam, $filepath, $mailto, $subject, $message) {
$filename = $filenam;
$file = $filepath;
$file_size = filesize($file);
$handle = fopen($file, "r");
$content = fread($handle, $file_size);
fclose($handle);
$content = chunk_split(base64_encode($content));
$uid = md5(uniqid(time()));
$name = basename($file);
$header = "MIME-Version: 1.0\r\n";
$header .= "Content-Type: multipart/mixed; boundary=\"".$uid."\"\r\n\r\n";
$header .= "This is a multi-part message in MIME format.\r\n";
$header .= "--".$uid."\r\n";
$header .= "Content-type:text/html; charset=iso-8859-1\r\n";
$header .= "Content-Transfer-Encoding: 7bit\r\n\r\n";
$header .= $message."\r\n\r\n";
$header .= "--".$uid."\r\n";
$header .= "Content-Type: application/octet-stream; name=\"".$filename."\"\r\n"; // use diff. tyoes here
$header .= "Content-Transfer-Encoding: base64\r\n";
$header .= "Content-Disposition: attachment; filename=\"".$filename."\"\r\n\r\n";
$header .= $content."\r\n\r\n";
$header .= "--".$uid."--";
mail($mailto, $subject, "", $header);
}
?>
save the above file as mail_attachment.php.

how to use it.....
include "mail_attachment.php";
$destination="filepath";
/*
e.g
$file = $_FILES['attachement']['name'];
$tepmfile = $_FILES['attachement']['tmp_name'];
//$destination = $_SERVER['DOCUMENT_ROOT']."uploadedFiles/".$file;
$destination = "uploadedFiles/".$file;

*/
move_uploaded_file($tepmfile,$destination);
$to = "rex.php@gmail.com"; // to email id

//$subject ="your subject";
$msg = "Your message";
// call mail attachment function
mail_attachment( $file, $destination, $to,$subject, $msg);
?>
html code below............

Tuesday, October 21, 2008

scour.com search engine

Have you heard about Scour? Scour is the next generation search engine with Yahoo/MSN/Google results and users comments all on one page. The best of all, you get paid for using it by earning points with every search you made. Also you get scores per comment and vote. The points are then converted to Visa gift cards. It is more or less like earning credit card or airline points just for searching.

Scour.com launched as a "meta" social search engine, which encourages voting and commentary on search engine query results called from Google, Yahoo! and MSN. Scour differentiates itself from other social search, ratings, and community sites in that it lets users vote and comment on search results, provides privacy control, gives weight to preferred engines, and lets people redeem search points for VISA gift cards. Scour pulls search results from the top three search engines. From there it relies on feedback to make the results ever more relevant.
Cool, isn’t it ?

Web 2.0 Technology

In the last few years, we have witnessed an explosion of Web-based, user-driven social computing, networking, and collaborative applications. These evolving applications come in many forms, including wikis (e.g., Wikipedia), blogs (e.g., Engadget), social networking sites (e.g., MySpace and Facebook), peer-to-peer file sharing (e.g., YouTube), social book marking and tagging (e.g., del.icio.us), mashups (e.g., Flash Earth), and virtual spaces (e.g., Second Life). This second generation of collaborative services—or Web 2.0—facilitates more dynamic participation and interaction online.

Web 2.0 concepts have led to the development and evolution of web-based communities and its hosted services, such as social networking sites, video sharing sites, blogs.

Web 2.0 is the Business revolution in the computer industry caused by the move to the Internet as, platform and an attempt to understand the rules for success on that new platform.

Thursday, August 21, 2008


Wednesday was the greatest day in the history of indian sports in olympics.
India have created history by winning three individual medals, it is a great achievement.
Hats off to them...
Vijender fought a great tactical bout, playing that 'defend and wait' game to perfection against Ecuadorian Carlos Gongora...
And
It was wrestler Sushil Kumar's supreme self confidence and the will to earn a medal for India that pushed him to get-up-and-go for the bronze medal in men's 66kg freestyle category

Now i can see the bright future of indian sports....What we all needed was motivation and self confidence that we can compete with the best...
Now sponsors will come forward to promote these sports and sportsman.
I hope government will also take initiative to provide better infrastructure and facilities to these sports and sportsman...