Tuesday, July 28, 2009

Export data to Excel in PHP

I will show you how to export data html to excel using php with oop implementation.
1. Create file viewhtml.php and excel.class.php(class file)

2. Write code in viewhtml.php :
*******************************

<?

ob_start(); //output buffering is active no output is sent from the script

include 'excel.class.php';

$data = "<table><tr><td>The Greatest Post</td><td>dot blogspot</td></tr></table>"; // the data you want to print

echo $data;

if(isset($_GET['export'])){

for ($i=1;$i<=5;$i++){
echo $data;
}

$create = new Excel; // create obj.

$create->CreateExcel($data,$_GET[export]); //call func. creat

}

?>

<a href="viewhtml.php?export=sini_letak_nama_file">Export Excel</a>

3. Write code in excel.class.php

**************************************

<?php

class Excel {

function CreateExcel($datatoprint,$filename){
header("Content-type: application/vnd.ms-excel");
header("Content-Disposition: attachment; filename=$filename.xls");
header("Pragma: no-cache");
header("Expires: 0");
echo $datatoprint;
}

}

?>

**********************************************

4. Run page viewhtml.php then click link to test.
Have try....!!


Monday, July 27, 2009

CSS Manual

Cascading Style Sheets (CSS) is a simple mechanism for adding style (e.g. fonts, colors, spacing) to Web documents. Important to web designer. I share the manual how to code css ( click the icon to download). Have fun!!. "Learn then Share".



Special thank to w3school
Thanks to who share.
Thanks to 000webhost.com

PHP Manual

PHP is a widely-used general-purpose scripting language that is especially suited for Web development and can be embedded into HTML.
For who want the guide or reference to write the code, click the icon to download the manual.
"Learn then Share".



Special thanks to http://www.php.net/

Thanks to who share this manual.
Thanks to 000webhost.com to sponsor the hosting.

MySQL Manual

Mysql is a relational database management system (RDBMS) which has more than 6 million installations. MySQL stands for "My Structured Query Language".
To who are new in mysql, you can download by click the icon. "Learn then Share".




Thanks to who share this manual.
Thanks to 000webhost.com to sponsor the hosting.

Special thanks to http://www.mysql.com/

Javascript Manual

This is java script manual that I found over the internet. I share with you and you will be able to develop your web with java script implemented. Click the icon to download. Have fun!!.



Thanks to who share this manual.
Thanks to 000webhost.com to sponsor the hosting.

Tuesday, July 21, 2009

OOP in PHP using method value with different file

file1.php
--------------------------------------

include ("file2.php");

$classme = new Two;
$classme->valueone = "What is the greatest post blog...";
$classme->display("The greatest post"," dot"," blogspot"); // call function and assign value

file2.php
-------------------------------------

class Two{

function display($var1,$var2,$var3){ //call value
echo $this->valueone;
echo $var1.$var2.$var3;
}
}

Monday, July 20, 2009

Simple oop in php use $this->. in diffrence file

This code is show how to use $this->var in php using oop implementation.

this file name file1.php.
---------------------------------------

include ("file2.php");

$classme = new Two;
$classme->valueone = "I love my name";
$classme->display(); // call function


this file name file2.php.
---------------------------------------

class Two{

function display(){
echo $this->valueone;
echo "
Do action, condition or anything here....";
}
}

----------------------------------------

Function display will have the value( $this->valueone): I love my name

Have fun!!!
Give your comment.... :)

Wednesday, July 15, 2009

Create Facebook Application - Started

First You need to navigate to site : http://developers.facebook.com/?ref=pf

then click start now:

After that site that ask you to allow access. just click allow.
This page will appear then you just click set up new application to get start to create application.



Then, you need to fill the form about your application information then setup field required.




At the last you can use tool to setup your API,FBML and template. and publish it.



Have FUN!!!!

CAKE PHP

CakePHP is a rapid development framework for PHP that provides an extensible architecture for developing, maintaining, and deploying applications. Using commonly known design patterns like MVC and ORM within the convention over configuration paradigm, CakePHP reduces development costs and helps developers write less code.

Release: 1.2.3.8166 Stable
  • No Configuration - Set-up the database and let the magic begin
  • Extremely Simple - Just look at the name...It's Cake
  • Active, Friendly Community - Join us #cakephp on IRC. We'd love to help you get started.
  • Flexible License - Distributed under the MIT License
  • Clean IP - Every line of code was written by the CakePHP development team
  • Best Practices - covering security, authentication, and session handling, among the many other features.
  • OO - Whether you are a seasoned object-oriented programmer or a beginner, you'll feel comfortable


You can easily download and research on CakePHP site.

Sunday, July 12, 2009

Bing - Faster than Google??


First, you try to search a key to google than try the same key to bing.com.
Do you get the different time of result..?
SAME is search engine.
Different is brand lol....

Monday, July 6, 2009

Create drop-down menu in joomla 1.5

refer to this site :
http://www.siteground.com/tutorials/joomla15/joomla_dropdown_menu.htm

see this for your best solution here-->