Archive for 'Tutorial'

How to use post and get method in ajax

Posted on 23. Apr, 2009 by admin.

2

Using GET method

Now we open a connection using the GET method.


var url = "get_data.php";
var params = "lorem=ipsum&name=binny";
http.open("GET", url+"?"+params, true);
http.onreadystatechange = function() {//Call a function when the state changes.
	if(http.readyState == 4 && http.status == 200) {
		alert(http.responseText);
	}
}
http.send(null);

I really hope that this much is clear for you – I am assuming that you know a bit of Ajax coding. If you don’t, please read a ajax tutorial that explains these parts before continuing.

POST method

We are going to make some modifications so POST method will be used when sending the request…


var url = "get_data.php";
var params = "lorem=ipsum&name=binny";
http.open("POST", url, true);

//Send the proper header information along with the request
http.setRequestHeader("Content-type", "application/x-www-form-urlencoded");
http.setRequestHeader("Content-length", params.length);
http.setRequestHeader("Connection", "close");

http.onreadystatechange = function() {//Call a function when the state changes.
	if(http.readyState == 4 && http.status == 200) {
		alert(http.responseText);
	}
}
http.send(params);

The first change(and the most obvious one) is that I changed the first argument of the open function from GET to POST. Also notice the difference in the second argument – in the GET method, we send the parameters along with the url separated by a ‘?’ character…

http.open("GET",url+"?"+params, true);

But in the POST method we will use just the url as the second argument. We will send the parameters later.

http.open("POST", url, true);

Some http headers must be set along with any POST request. So we set them in these lines…

http.setRequestHeader("Content-type", "application/x-www-form-urlencoded");
http.setRequestHeader("Content-length", params.length);
http.setRequestHeader("Connection", "close");

With the above lines we are basically saying that the data send is in the format of a form submission. We also give the length of the parameters we are sending.

http.onreadystatechange = function() {//Call a function when the state changes.
	if(http.readyState == 4 && http.status == 200) {
		alert(http.responseText);
	}
}

We set a handler for the ‘ready state’ change event. This is the same handler we used for the GET method. You can use the http.responseText here – insert into a div using innerHTML(AHAH), eval it(JSON) or anything else.

http.send(params);

Finally, we send the parameters with the request. The given url is loaded only after this line is called. In the GET method, the parameter will be a null value. But in the POST method, the data to be send will be send as the argument of the send function. The params variable was declared in the second line as “lorem=ipsum&name=binny” – so we send two parameters – ‘lorem’ and ‘name’ with the values ‘ipsum’ and ‘binny’ respectively.

Continue Reading

How to create rss using php – some easy steps

Posted on 23. Apr, 2009 by admin.

0

Step 1: Find your content.
An RSS feed should probably list all the content items in your main section. For example, if you run a blog, you can have an RSS feed of all your latest posts.  If you run a small download site, consider a feed of your latest releases. Whatever content you choose, make sure it’s interesting, and will be updated regularly – aim for between 3-6 times a week, if you have a choice. Then just write out your basic database logic and get the data into an array. I’ll use $items for this example.

Step 2: Get your basic RSS structure.
RSS is an XML-based format, so all you really need is a set of XML tags as part of the RSS specification. RSS provides a number of optional tags, and being XML, it can be (and often is) extended with any other tag.  You can borrow the basic structure from any feed,  (load it up and right click > view source), but here’s a sample you can use:

<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0">
<channel>
  <title>My Blog Name</title>
  <link>http://example.com/blog</link>
  <description>Keeping webmasters up-to-date on technology.</description>
  <pubDate>Tue, 15 Apr 2008 18:00:00 +0000</pubDate>
  <item>
    <title>Story Title</title>
    <pubDate>Tue, 15 Apr 2008 18:00:00 +0000</pubDate>
    <link>http://example.com/my/story</link>
    <description>Today I saw a whale!</description>
  </item>
</channel>
</rss>

The easiest way to build your RSS feed in PHP is to leave all of that XML as plain text and only loop over the sections as needed (the <item> tags). The one gotcha here, as you’ve probably noticed, is the opening <?xml tag. This will probably clash with PHP, so instead echo that line out:

<?php echo "<?xml version=\"1.0\" encoding=\"UTF-8\"?>"; ?>

Then your structure is all in place. The item element is repeated for each story we have in our RSS feed; the date is RFC 2822 formatted (just use date("r")). We’ll use a simple foreach loop to put the content in:

<?php foreach ($items as $item) { ?>
  <item>
    <title><?=$item['title']?></title>
    <pubDate><?=date("r",$item['time'])?></pubDate>
    <link><?=$item['url']?></link>
    <description><?=$item['description']?></description>
  </item>
<?php } ?>

3. Serve it up!
To be recognised as an RSS feed, you’ll need to serve it as the right content type. Technically you should use application/rss+xml, but most browsers won’t recognise this. I find application/xhtml+xml works well, as does text/xml. The choice is yours, although IE7 seems to like text/xml better.

<?php header("Content-type: text/xml"); ?>

And we’re done!

Here’s a sample of the final product:

<?php header("Content-type: text/xml"); ?>
<?php echo "<?xml version=\"1.0\" encoding=\"UTF-8\"?>"; ?>
<rss version="2.0">
<channel>
  <title>My Blog Name</title>
  <link>http://example.com/blog</link>
  <description>Keeping webmasters up-to-date on technology.</description>
  <pubDate>Tue, 15 Apr 2008 18:00:00 +0000</pubDate>
<?php foreach ($items as $item) { ?>
  <item>
    <title><?=$item['title']?></title>
    <pubDate><?=date("r",$item['time'])?></pubDate>
    <link><?=$item['url']?></link>
    <description><?=$item['description']?></description>
  </item>
<?php } ?>
</channel>
</rss>

Continue Reading

Parse Xml using jquery

Posted on 23. Apr, 2009 by admin.

0

Suppose we have a file name xml file as below

<?xml version=“1.0″ encoding=“utf-8″ ?>

<RecentTutorials>
<Tutorial author=“The Reddest”>
<Title>Silverlight and the Netflix API</Title>
<Categories>
<Category>Tutorials</Category>
<Category>Silverlight 2.0</Category>
<Category>Silverlight</Category>
<Category>C#</Category>
<Category>XAML</Category>
</Categories>
<Date>1/13/2009</Date>
</Tutorial>
<Tutorial author=“The Hairiest”>
<Title>Cake PHP 4 – Saving and Validating Data</Title>
<Categories>
<Category>Tutorials</Category>
<Category>CakePHP</Category>
<Category>PHP</Category>
</Categories>
<Date>1/12/2009</Date>
</Tutorial>
<Tutorial author=“The Tallest”>
<Title>Silverlight 2 – Using initParams</Title>
<Categories>
<Category>Tutorials</Category>
<Category>Silverlight 2.0</Category>
<Category>Silverlight</Category>
<Category>C#</Category>
<Category>HTML</Category>
</Categories>
<Date>1/6/2009</Date>
</Tutorial>
<Tutorial author=“The Fattest”>
<Title>Controlling iTunes with AutoHotkey</Title>
<Categories>
<Category>Tutorials</Category>
<Category>AutoHotkey</Category>
</Categories>
<Date>12/12/2008</Date>
</Tutorial>
</RecentTutorials>

The first thing you’re going to have to do is write some jQuery to request the XML document. This is a very simple AJAX request for the file.

$(document).ready(function()
{
$.ajax({
type: “GET”,
url: “jquery_xml.xml”,
dataType: “xml”,
success: parseXml
});
});

Now that that’s out of the way, we can start parsing the XML. As you can see, when the request succeeds, the function parseXML is called. That’s where I’m going to put my code. Let’s start by finding the author of each tutorial, which are stored as attributes on the Tutorial tag.

function parseXml(xml)
{
//find every Tutorial and print the author
$(xml).find(“Tutorial”).each(function()
{
$(“#output”).append($(this).attr(“author”) + “<br />”);
});

// Output:
// The Reddest
// The Hairiest
// The Tallest
// The Fattest
}


Continue Reading

Remotely login script throw curl in php

Posted on 21. Apr, 2009 by admin.

3

As we know php doesnt cum up with curl support by default for this u have to download a separte module libcurl which is basically for php. Using curl you can login to another site , grab the data and then log it off , just like a simple user do , you can use the below script for login to another site using curl

<?php
// INIT CURL
$ch = curl_init();

// SET URL FOR THE POST FORM LOGIN
curl_setopt($ch, CURLOPT_URL, ‘http://www.external-site.com/Members/Login.php’);

// ENABLE HTTP POST
curl_setopt ($ch, CURLOPT_POST, 1);

// SET POST PARAMETERS : FORM VALUES FOR EACH FIELD
curl_setopt ($ch, CURLOPT_POSTFIELDS, ‘fieldname1=fieldvalue1&fieldname2=fieldvalue2′);

// IMITATE CLASSIC BROWSER’S BEHAVIOUR : HANDLE COOKIES
curl_setopt ($ch, CURLOPT_COOKIEJAR, ‘cookie.txt’);

# Setting CURLOPT_RETURNTRANSFER variable to 1 will force cURL
# not to print out the results of its query.
# Instead, it will return the results as a string return value
# from curl_exec() instead of the usual true/false.
curl_setopt ($ch, CURLOPT_RETURNTRANSFER, 1);

// EXECUTE 1st REQUEST (FORM LOGIN)
$store = curl_exec ($ch);

// SET FILE TO DOWNLOAD
curl_setopt($ch, CURLOPT_URL, ‘http://www.external-site.com/Members/Downloads/AnnualReport.pdf’);

// EXECUTE 2nd REQUEST (FILE DOWNLOAD)
$content = curl_exec ($ch);

// CLOSE CURL
curl_close ($ch);

?>

Continue Reading

PHP interview question part 4

Posted on 03. Apr, 2009 by admin.

0

1. How many ways can we get the value of current session id?
session_id() returns the session id for the current session.
2. How can we destroy the session, how can we unset the variable of a session?
session_unregister () Unregister a global variable from the current session
session_unset () Free all session variables
3. How can we destroy the cookie?

Ans:- Use setcookie function with all parameter but set the time limit in negative for suppose destroying a cookie for name admin just use s

setcookie ("admin", "", time() - 3600);

4. How many ways we can pass the variable through the navigation between the pages?
Ans:- Through QueryString and POST methods
5. What is the difference between ereg_replace() and eregi_replace()?
Ans:-eregi_replace() function is identical to ereg_replace() except that this ignores case distinction when matching alphabetic characters.eregi_replace() function is identical to ereg_replace() except that this ignores case distinction when matching alphabetic characters.

6. What are the different functions in sorting an array?
Ans:-
Sorting functions in PHP,
asort-http://www.php.net/manual/en/function.asort.php
arsort-http://www.php.net/manual/en/function.arsort.php
ksort-http://www.php.net/manual/en/function.ksort.php
krsort-http://www.php.net/manual/en/function.krsort.php
uksort-http://www.php.net/manual/en/function.uksort.php
sort-http://www.php.net/manual/en/function.sort.php
natsort-http://www.php.net/manual/en/function.natsort.php
rsort-http://www.php.net/manual/en/function.rsort.php
7. How can we know the count/number of elements of an array?
Ans:-2 ways
a) sizeof($urarray) This function is an alias of count()
b) count($urarray)
interestingly if u just pass a simple var instead of a an array it will return 1.

8. What are the difference between abstract class and interface?
Abstract class: abstract classes are the class where one or more methods are abstract but not necessarily all method has to be abstract. Abstract methods are the methods, which are declare in its class but not define. The definition of those methods should be in its extending class.but not necessary.
Interface: Interfaces are one type of class where all the methods are abstract. That means all the methods only declared but not defined. All the methods must be define by its implemented class.
9. How can we send mail-using JavaScript?

We can use mailto:gmail.com function to send mail through javascript
10. How can we repair a mysql table?
The syntex for repairing a mysql table is
REPAIR TABLENAME, [TABLENAME, ], [Quick],[Extended]
This command will repair the table specified if the quick is given the mysql will do a repair of only the index tree if the extended is given it will create index row by row
11. What are the advantages of stored procedures, triggers, indexes?
A stored procedure is a set of SQL commands that can be compiled and stored in the server. Once this has been done, clients don’t need to keep re-issuing the entire query but can refer to the stored procedure. This provides better overall performance because the query has to be parsed only once, and less information needs to be sent between the server and the client. You can also raise the conceptual level by having libraries of functions in the server. However, stored procedures of course do increase the load on the database server system, as more of the work is done on the server side and less on the client (application) side.
Triggers will also be implemented. A trigger is effectively a type of stored procedure, one that is invoked when a particular event occurs. For example, you can install a stored procedure that is triggered each time a record is deleted from a transaction table and that stored procedure automatically deletes the corresponding customer from a customer table when all his transactions are deleted.
Indexes are used to find rows with specific column values quickly. Without an index, MySQL must begin with the first row and then read through the entire table to find the relevant rows. The larger the table, the more this costs. If the table has an index for the columns in question, MySQL can quickly determine the position to seek to in the middle of the data file without having to look at all the data. If a table has 1,000 rows, this is at least 100 times faster than reading sequentially. If you need to access most of the rows, it is faster to read sequentially, because this minimizes disk seeks.
12. What is the maximum length of a table name, database name, and fieldname in mysql?
Database name- 64
Table name -64
Fieldname-64
13. How many values can the SET function of mysql takes?
Mysql set can take zero or more values but at the maximum it can take 64 values
14. What are the other commands to know the structure of table using mysql commands except explain command?
describe table_name;
15. How many tables will create when we create table, what are they?
3 tables will create when we create table. They are
The ‘.frm’ file stores the table definition.
The data file has a ‘.MYD’ (MYData) extension.
The index file has a ‘.MYI’ (MYIndex) extension,

Continue Reading

PHP interview Quesion Part 3

Posted on 03. Apr, 2009 by admin.

0
    1. How can we encrypt the username and password using php?
    It all depends upon either you want to decode the password or not if u dont want to decode the password then the best way is to use the md5 function but if you want to decode as well either use baase_enocde function or use inbuilt classes freely available for encoding and decoding and you can also refer to phpclasses.com and php.net for this for base encodingt We can use  data using base64_encode($string) and can decode using base64_decode($string);

    2. What are the features and advantages of OBJECT ORIENTED PROGRAMMING?

    In short extendablity, flexablity, ease to maintain , Less coding , Reusablity and security
    One of the main advantages of OO programming is its ease of modification; objects can easily be modified and added to a system there by reducing maintenance costs. OO programming is also considered to be better at modeling the real world than is procedural programming. It allows for more complicated and flexible interactions. OO systems are also easier for non-technical personnel to understand and easier for them to participate in the maintenance and enhancement of a system because it appeals to natural human cognition patterns.
    For some systems, an OO approach can speed development time since many objects are standard across systems and can be reused. Components that manage dates, shipping, shopping carts, etc. can be purchased and easily modified for a specific system.

3. What is the use of friend function?
Friend functions
Sometimes a function is best shared among a number of different classes. Such functions can be declared either as member functions of one class or as global functions. In either case they can be set to be friends of other classes, by using a friend specifier in the class that is admitting them. Such functions can use all attributes of the class whichnames them as a friend, as if they were themselves members of that class.
A friend declaration is essentially a prototype for a member function, but instead of requiring an implementation with the name of that class attached by the double colon syntax, a global function or member function of another class provides the match.

class mylinkage
{
private:
mylinkage * prev;
mylinkage * next;
protected:
friend void set_prev(mylinkage* L, mylinkage* N);
void set_next(mylinkage* L);
public:
mylinkage * succ();
mylinkage * pred();
mylinkage();
};
void mylinkage::set_next(mylinkage* L) { next = L; }
void set_prev(mylinkage * L, mylinkage * N ) { N->prev = L; }

Friends in other classes
It is possible to specify a member function of another class as a friend as follows:

class C
{
friend int B::f1();
};
class B
{
int f1();
};

It is also possible to specify all the functions in another class as friends, by specifying the entire class as a friend.

class A
{
friend class B;
};
Friend functions allow binary operators to be defined which combine private data in a pair of objects. This is particularly powerful when using the operator overloading features of C++. We will return to it when we look at overloading.

    4. What are the differences between PROCEDURE ORIENTED LANGUAGES and OBJECT ORIENTED LANGUAGES?
    Traditional programming has the following characteristics:
    Functions are written sequentially, so that a change in programming can affect any code that follows it.
    If a function is used multiple times in a system (i.e., a piece of code that manages the date), it is often simply cut and pasted into each program (i.e., a change log, order function, fulfillment system, etc). If a date change is needed (i.e., Y2K when the code needed to be changed to handle four numerical digits instead of two), all these pieces of code must be found, modified, and tested.
    Code (sequences of computer instructions) and data (information on which the instructions operates on) are kept separate. Multiple sets of code can access and modify one set of data. One set of code may rely on data in multiple places. Multiple sets of code and data are required to work together. Changes made to any of the code sets and data sets can cause problems through out the system.
    Object-Oriented programming takes a radically different approach:
    Code and data are merged into one indivisible item – an object (the term “component” has also been used to describe an object.) An object is an abstraction of a set of real-world things (for example, an object may be created around “date”) The object would contain all information and functionality for that thing (A date
    object it may contain labels like January, February, Tuesday, Wednesday. It may contain functionality that manages leap years, determines if it is a business day or a holiday, etc., See Fig. 1). Ideally, information about a particular thing should reside in only one place in a system. The information within an object is encapsulated (or hidden) from the rest of the system.
    A system is composed of multiple objects (i.e., date function, reports, order processing, etc., See Fig 2). When one object needs information from another object, a request is sent asking for specific information. (for example, a report object may need to know what today’s date is and will send a request to the date object) These requests are called messages and each object has an interface that manages messages.
    OO programming languages include features such as “class”, “instance”, “inheritance”, and “polymorphism” that increase the power and flexibility of an object.

5. What are the different types of errors in php?
Three are three types of errors:
1. Notices: These are trivial, non-critical errors that PHP encounters while executing a script – for example, accessing a variable that has not yet been defined. By default, such errors are not displayed to the user at all – although, as you will see, you can change this default behaviour.
2. Warnings: These are more serious errors – for example, attempting to include() a file which does not exist. By default, these errors are displayed to the user, but they do not result in script termination.
3. Fatal errors: These are critical errors – for example, instantiating an object of a non-existent class, or calling a non-existent function. These errors cause the immediate termination of the script, and PHP’s default behaviour is to display them to the user when they take place.
6. What is the functionality of the function strstr and stristr?
strstr() returns part of a given string from the first occurrence of a given substring to the end of the string. For example: strstr(”user@example.com”,”@”) will return “@example.com”.
stristr() is idential to strstr() except that it is case insensitive.

7. What is the functionality of the function htmlentities? Answer: htmlentities — Convert all applicable characters to HTML entities
This function is identical to htmlspecialchars() in all ways, except with htmlentities(), all characters which have HTML character entity equivalents are translated into these entities.
8. How can we get second of the current time using date function?
$second = date(”s”);
9. What is meant by urlencode and urldocode?
urlencode() returns the URL encoded version of the given string. URL coding converts special characters into % signs followed by two hex digits. For example: urlencode(”10.00%”) will return “10%2E00%25?. URL encoded strings are safe to be used as part of URLs.
urldecode() returns the URL decoded version of the given string.
10. What is the difference between the functions unlink and unset?
unlink() deletes the given file from the file system.
unset() makes a variable undefined.
11. How can we register the variables into a session?
We can use the session_register ($ur_session_var) function.
12. How can we get the properties (size, type, width, height) of an image using php image functions?
To get the Image type use exif_imagetype () function
To get the Image size use getimagesize () function
To get the image width use imagesx () function
To get the image height use imagesy() function

13. What is the maximum size of a file that can be uploaded using php and how can we change this?
You can change maximum size of a file set upload_max_filesize variable in php.ini file where as the max size by default is 2 mb
14. How can we increase the execution time of a php script?
Set max_execution_time variable in php.ini file to your desired time in second.
15. How can we take a backup of a mysql table and how can we restore it.?
Answer: Create a full backup of your database: shell> mysqldump “tab=/path/to/some/dir opt db_name Or: shell> mysqlhotcopy db_name /path/to/some/dir
The full backup file is just a set of SQL statements, so restoring it is very easy:

shell> mysql “.”Executed”;
mysql_close($link2);

Continue Reading

Php interview Questions – part II

Posted on 03. Apr, 2009 by admin.

0
    1. What is the differences between GET and POST methods in form submitting?

    - On the server side, the main difference between GET and POST is where the submitted is stored. The $_GET array stores data submitted by the GET method. The $_POST array stores data submitted by the POST method.
    On the client  side, the difference is that data submitted by the GET method will be displayed in the browsers address field. Data submitted by the POST method will not be displayed anywhere on the browser.

    GET method is used for chunk of information for less insensitve data and Post method is used for large amotund of data which is sensitive in nature.

    2. Who is the father of php and explain the changes in php versions?
    - Rasmus Lerdorf

    3. How can we submit from without a submit button?
    We can Trigger a Javascript code on a particular event in javascript function Like on button click we can call a function which contain the function submit() . In the JavaScript code, we can call the document.form.submit() function to submit the form.

    4. What is the difference between mysql_fetch_object and mysql_fetch_array?
    mssql fetch object will take first single matching record where mysql_fetch_array will get all matching records from the table in an array.

5. How can we create a database using php and mysql?

We can call a inbuilt function for creating a database in PHP i.e mysql_create_db() but we have to take this into consideration                                      while  working on server the user should have rights to create the database and for mysql we can simply call the query the database i.e        create database;

6. What are the differences between require and include, include_once?

include and require it differ in how they handle failures. If the file is not found by require(), it will definatly cause a fatal error and halt the execution of the script. If the file is not found by include(), a warning will be issued, but execution will continue.

7. How many ways we can get the data in result set of mysql Using php?
As individual objects so single record or as a set or arrays.

    8. What are the different tables present in mysql, which type of table is generated when we are creating a table in the following
    syntax: create table emp(no int(12),name varchar(20)) ?
    Total 5 types of tables we can create
    1. MyISAM
    2. Heap
    3. Merge
    4. InnoDB
    5. ISAM
    6. BDB
    MyISAM is the default storage engine as of MySQL 3.23.

9. What is the difference between $message and $$message?
They are both variables. But $message is a variable with a constant or you can say a fixed value but $$message is a variable which stores the address of $message
10. How can I execute a php script using command line?
Just run the PHP CLI (Command Line Interface) program and provide the PHP script file name as the command line argument. For example, “php myScript.php”, assuming “php” is the command to invoke the CLI program.
Be aware that if your PHP script was written for the Web CGI interface, it may not execute properly in command line environment.

11. Suppose your ZEND engine supports the mode Then how can u configure your php ZEND engine to support mode ?
Just change the line  short_open_tag = off in php.ini file settings. Then your php ZEND engine support only mode.

12. What is meant by nl2br()?
nl2br() Inserts HTML line breaks before all newlines in a string string nl2br (string); Returns string with br inserted before all newlines. For example: echo nl2br(”Gud day \n Sir”) will output “gud day \n sir” to your browser.

13. What are the current versions of apache, php, and mysql?
PHP: php5.4.2
MySQL: MySQL 5
Apache: Apache 2

14. What are the reason for chossing  LAMP (Linux, apache, mysql, php) instead of WAMP?
All of those are open source resource. Security of linux is very very more than windows. Apache is a better server that IIS both in functionality and security. Mysql is world most popular open source database. Php is more faster that asp or any other scripting language.

15. How can we encrypt and decrypt a data present in a mysql table using mysql?
Two  Functions are there for this : AES_ENCRYPT () and AES_DECRYPT ()

Continue Reading

Interview question — Part 5

Posted on 03. Apr, 2009 by admin.

0

1. What is the purpose of the following files having extensions 1) frm 2) MYD 3) MYI. What these files contains?
In MySql, the default table type is MyISAM.
Each MyISAM table is stored on disk in three files. The files have names that begin with the table name and have an extension to indicate the file type.
The ‘.frm’ file stores the table definition.
The data file has a ‘.MYD’ (MYData) extension.
The index file has a ‘.MYI’ (MYIndex) extension,

2. What is maximum size of a database in mysql?
If the operating system or filesystem places a limit on the number of files in a directory, MySQL is bound by that constraint.
The efficiency of the operating system in handling large numbers of files in a directory can place a practical limit on the number of tables in a database. If the time required to open a file in the directory increases significantly as the number of files increases, database performance can be adversely affected.
The amount of available disk space limits the number of tables.
MySQL 3.22 had a 4GB (4 gigabyte) limit on table size. With the MyISAM storage engine in MySQL 3.23, the maximum table size was increased to 65536 terabytes (2567 – 1 bytes). With this larger allowed table size, the maximum effective table size for MySQL databases is usually determined by operating system constraints on file sizes, not by MySQL internal limits.
The InnoDB storage engine maintains InnoDB tables within a tablespace that can be created from several files. This allows a table to exceed the maximum individual file size. The tablespace can include raw disk partitions, which allows extremely large tables. The maximum tablespace size is 64TB.
The following table lists some examples of operating system file-size limits. This is only a rough guide and is not intended to be definitive. For the most up-to-date information, be sure to check the documentation specific to your operating system.
Operating System File-size Limit
Linux 2.2-Intel 32-bit 2GB (LFS: 4GB)
Linux 2.4+ (using ext3 filesystem) 4TB
Solaris 9/10 16TB
NetWare w/NSS filesystem 8TB
Win32 w/ FAT/FAT32 2GB/4GB
Win32 w/ NTFS 2TB (possibly larger)
MacOS X w/ HFS+ 2TB
3. Give the syntax of Grant and Revoke commands?
The generic syntax for grant is as following
> GRANT [rights] on [database/s] TO [username@hostname] IDENTIFIED BY [password]
now rights can be
a) All privileges
b) combination of create, drop, select, insert, update and delete etc.
We can grant rights on all databse by using *.* or some specific database by database.* or a specific table by database.table_name
username@hotsname can be either username@localhost, username@hostname and username@%
where hostname is any valid hostname and % represents any name, the *.* any condition
password is simply the password of user
The generic syntax for revoke is as following
> REVOKE [rights] on [database/s] FROM [username@hostname]
now rights can be as explained above
a) All privileges
b) combination of create, drop, select, insert, update and delete etc.
username@hotsname can be either username@localhost, username@hostname and username@%
where hostname is any valid hostname and % represents any name, the *.* any condition
4. Explain Normalization concept?
The normalization process involves getting our data to conform to three progressive normal forms, and a higher level of normalization cannot be achieved until the previous levels have been achieved (there are actually five normal forms, but the last two are mainly academic and will not be discussed).
First Normal Form
The First Normal Form (or 1NF) involves removal of redundant data from horizontal rows. We want to ensure that there is no duplication of data in a given row, and that every column stores the least amount of information possible (making the field atomic).
Second Normal Form
Where the First Normal Form deals with redundancy of data across a horizontal row, Second Normal Form (or 2NF) deals with redundancy of data in vertical columns. As stated earlier, the normal forms are progressive, so to achieve Second Normal Form, your tables must already be in First Normal Form.
Third Normal Form
I have a confession to make; I do not often use Third Normal Form. In Third Normal Form we are looking for data in our tables that is not fully dependant on the primary key, but dependant on another value in the table
5. How can we find the number of rows in a table using mysql?
Answer: Use this for mysql
>SELECT COUNT(*) FROM table_name;
but if u r particular about no of rows with some special result
do this
>SELECT [colms],COUNT(*) FROM table_name [where u put conditions];
68. How can we find the number of rows in a result set using php?
Answer: for PHP

$result = mysql_query($any_valid_sql, $database_link);
$num_rows = mysql_num_rows($result);
echo “$num_rows rows found”;
6. How many ways we can we find the current date using mysql?
SELECT CURDATE();
CURRENT_DATE() = CURDATE()
for time use
SELECT CURTIME();
CURRENT_TIME() = CURTIME()
7. What are the advantages and disadvantages of CASCADE STYLE SHEETS?
External Style Sheets
Advantages
Can control styles for multiple documents at once
Classes can be created for use on multiple HTML element types in many documents
Selector and grouping methods can be used to apply styles under complex contexts
Disadvantages
An extra download is required to import style information for each document
The rendering of the document may be delayed until the external style sheet is loaded
Becomes slightly unwieldy for small quantities of style definitions
Embedded Style Sheets
Advantages
Classes can be created for use on multiple tag types in the document
Selector and grouping methods can be used to apply styles under complex contexts
No additional downloads necessary to receive style information
Disadvantages
This method can not control styles for multiple documents at once
Inline Styles
Advantages
Useful for small quantities of style definitions
Can override other style specification methods at the local level so only exceptions need to be listed in conjunction with other style methods
Disadvantages
Does not distance style information from content (a main goal of SGML/HTML)
Can not control styles for multiple documents at once
Author can not create or control classes of elements to control multiple element types within the document
Selector grouping methods can not be used to create complex element addressing scenarios

8. What are the advantages/disadvantages of mysql and php?
Both of them are open source software (so free of cost), support cross platform. php is faster then ASP and JSP.
9. What is the difference between GROUP BY and ORDER BY in Sql?
To sort a result, use an ORDER BY clause.
The most general way to satisfy a GROUP BY clause is to scan the whole table and create a new temporary table where all rows from each group are consecutive, and then use this temporary table to discover groups and apply aggregate functions (if any).
ORDER BY [col1],[col2],[coln]; Tels DBMS according to what columns it should sort the result. If two rows will hawe the same value in col1 it will try to sort them according to col2 and so on.
GROUP BY [col1],[col2],…,[coln]; Tels DBMS to group results with same value of column col1. You can use COUNT(col1), SUM(col1), AVG(col1) with it, if you want to count all items in group, sum all values or view average
10. What is the difference between char and varchar data types?
char(M) M bytes 0
80. How can we change the name of a column of a table?
MySQL query to rename table: RENAME TABLE tbl_name TO new_tbl_name
[, tbl_name2 TO new_tbl_name2]
or,
ALTER TABLE tableName CHANGE OldName newName.
11. How can we change the name and data type of a column of a table?
ALTER [IGNORE] TABLE tbl_name
alter_specification [, alter_specification] | CHANGE [COLUMN] old_col_name column_definition
[FIRST|AFTER col_name]
12. What are the differences between drop a table and truncate a table?
Answer: Delete a Table or DatabaseTo delete a table (the table structure, attributes, and indexes will also be deleted).
What if we only want to get rid of the data inside a table, and not the table itself? Use the TRUNCATE TABLE command (deletes only the data inside the table).
13. When viewing an HTML page in a Browser, the Browser often keeps this page in its cache. What can be possible advantages/disadvantages of page caching? How can you prevent caching of a certain page (please give several alternate solutions)?
When you use the metatag in the header section at the beginning of an HTML Web page, the Web page may still be cached in the Temporary Internet Files folder.
A page that Internet Explorer is browsing is not cached until half of the 64 KB buffer is filled. Usually, metatags are inserted in the header section of an HTML document, which appears at the beginning of the document. When the HTML code is parsed, it is read from top to bottom. When the metatag is read, Internet Explorer looks for the existence of the page in cache at that exact moment. If it is there, it is removed. To properly prevent the Web page from appearing in the cache, place another header section at the end of the HTML ocument.
14. What are the different ways to login to a remote server? Explain the means, advantages and disadvantages?
There is at least 3 ways to logon to a remote server:
Use ssh or telnet if you concern with security
You can also use rlogin to logon to a remote server.

15. What is meant by MIME?
Multipurpose Internet Mail Extensions.
WWW’s ability to recognise and handle files of different types is largely dependent on the use of the MIME (Multipurpose Internet Mail Extensions) standard. The standard provides for a system of registration of file types with information about the applications needed to process them. This information is incorporated into Web server and browser software, and enables the automatic recognition and display of registered file types.
16. What is meant by PEAR in php?
PEAR is short for “PHP Extension and Application Repository” and is pronounced just like the fruit. The purpose of PEAR is to provide:
A structured library of open-sourced code for PHP users
A system for code distribution and package maintenance
A standard style for code written in PHP
The PHP Foundation Classes (PFC),
The PHP Extension Community Library (PECL),
A web site, mailing lists and download mirrors to support the PHP/PEAR community
PEAR is a community-driven project with the PEAR Group as the governing body. The project has been founded by Stig S. Bakken in 1999 and quite a lot of people have joined the project since then.
http://pear.php.net/manual/en/introduction.php
96. How can I use the COM components in php?
The COM class provides a framework to integrate (D)COM components into your PHP scripts.
string COM::COM ( string module_name [, string server_name [, int codepage]])
COM class constructor. Parameters:
module_name
name or class-id of the requested component.
server_name
name of the DCOM server from which the component should be fetched. If NULL, localhost is assumed. To allow DCOM com.allow_dcom has to be set to TRUE in php.ini.
codepage
specifies the codepage that is used to convert php-strings to unicode-strings and vice versa. Possible values are CP_ACP, CP_MACCP, CP_OEMCP, CP_SYMBOL, CP_THREAD_ACP, CP_UTF7 and CP_UTF8.
Usage:
Version}\n”; //bring it to front $word->Visible = 1; //open an empty document $word->Documents->Add(); //do some weird stuff $word->Selection->TypeText(”This is a test…”); $word->Documents[1]->SaveAs(”Useless test.doc”); //closing word $word->Quit(); //free the object $word->Release(); $word = null; ?>
17. How can we know that a session is started or not?
a session starts by session_start()function.
this session_start() is always declared in header portion.it always declares first.then we write session_register().
18. What is the default session time in php and how can I change it?
The default session time in php is until closing of browser or 24 mins which is earlier
19. What changes I have to done in php.ini file for file uploading?
Make the following Line uncomment like:
; Whether to allow HTTP file uploads.
file_uploads = On
; Temporary directory for HTTP uploaded files (will use system default if not
; specified).
upload_tmp_dir = C:\apache2triad\temp
; Maximum allowed size for uploaded files.
upload_max_filesize = 2M

post_max_limit =8m

you have to increase those limits to increase the file size upload
20. What are the differences between mysql_fetch_array(), mysql_fetch_object(), mysql_fetch_row()?
mysql_fetch_array — Fetch a result row as an associative array, a numeric array, or both.
mysql_fetch_object ( resource result )
Returns an object with properties that correspond to the fetched row and moves the internal data pointer ahead. Returns an object with properties that correspond to the fetched row, or FALSE if there are no more rows
mysql_fetch_row() fetches one row of data from the result associated with the specified result identifier. The row is returned as an array. Each result column is stored in an array offset, starting at offset 0.
21. How can I set a cron and how can I execute it in Unix, Linux, and windows?
Cron is very simply a Linux module that allows you to run commands at predetermined times or intervals. In Windows, it’s called Scheduled Tasks. The name Cron is in fact derived from the same word from which we get the word chronology, which means order of time.
The easiest way to use crontab is via the crontab command.
# crontab –e
This command ‘edits’ the crontab. Upon employing this command, you will be able to enter the commands that you wish to run. My version of Linux uses the text editor vi. You can find information on using vi here.
The syntax of this file is very important – if you get it wrong, your crontab will not function properly. The syntax of the file should be as follows:
minutes hours day_of_month month day_of_week command
All the variables, with the exception of the command itself, are numerical constants. In addition to an asterisk (*), which is a wildcard that allows any value, the ranges permitted for each field are as follows:
Minutes: 0-59
Hours: 0-23
Day_of_month: 1-31
Month: 1-12
Weekday: 0-6
We can also include multiple values for each entry, simply by separating each value with a comma.
command can be any shell command and, as we will see momentarily, can also be used to execute a Web document such as a PHP file.
So, if we want to run a script every Tuesday morning at 8:15 AM, our mycronjob file will contain the following content on a single line:
15 8 * * 2 /path/to/scriptname
This all seems simple enough, right? Not so fast! If you try to run a PHP script in this manner, nothing will happen (barring very special configurations that have PHP compiled as an executable, as opposed to an Apache module). The reason is that, in order for PHP to be parsed, it needs to be passed through Apache. In other words, the page needs to be called via a browser or other means of retrieving Web content.
For our purposes, I’ll assume that your server configuration includes wget, as is the case with most default configurations. To test your configuration, log in to shell. If you’re using an RPM-based system (e.g. Redhat or Mandrake), type the following:
# wget –help
If you are greeted with a wget package identification, it is installed in your system.
You could execute the PHP by invoking wget on the URL to the page, like so:
# wget http://www.example.com/file.php
Now, let’s go back to the mailstock.php file we created in the first part of this article. We saved it in our document root, so it should be accessible via the Internet. Remember that we wanted it to run at 4PM Eastern time, and send you your precious closing bell report? Since I’m located in the Eastern timezone, we can go ahead and set up our crontab to use 4:00, but if you live elsewhere, you might have to compensate for the time difference when setting this value.
This is what my crontab will look like:
0 4 * * 1,2,3,4,5 wget http://www.example.com/mailstock.php

22. Steps for the payment gateway processing?
An online payment gateway is the interface between your merchant account and your Web site. The online payment gateway allows you to immediately verify credit card transactions and authorize funds on a customer’s credit card directly from your Web site. It then passes the transaction off to your merchant bank for processing, commonly referred to as transaction batching
23. How many ways I can register the variables into session?
session_register(); $_SESSION[]; $HTTP_SESSION_VARS[];

24. How many ways I can redirect a php page?
Here are the possible ways of php page redirection.
Using Java script:
‘; echo ‘window.location.href=”‘.$filename.’”;’; echo ”; echo ”; echo ”; echo ”; } } redirect(’http://maosjb.com’); ?>
Using php function:
Header(”Location:http://maosjb.com “);
25. List out different arguments in php header function?
void header ( string string [, bool replace [, int http_response_code]])
26. What type of headers have to add in the mail function in which file a attached?

$boundary = ‘—–=’ . md5( uniqid ( rand() ) );
$headers = “From: \”Me\”\n”;
$headers .= “MIME-Version: 1.0\n”;
$headers .= “Content-Type: multipart/mixed; boundary=\”$boundary\””;
27. What is the difference between and And which can be preferable?
move_uploaded_file ( string filename, string destination)
This function checks to ensure that the file designated by filename is a valid upload file (meaning that it was uploaded via PHP’s HTTP POST upload mechanism). If the file is valid, it will be moved to the filename given by destination.
If filename is not a valid upload file, then no action will occur, and move_uploaded_file() will return FALSE.
If filename is a valid upload file, but cannot be moved for some reason, no action will occur, and move_uploaded_file() will return FALSE. Additionally, a warning will be issued.
28. How can I embed a java programme in php file and what changeshave to be done in php.ini file?
There are two possible ways to bridge PHP and Java: you can either integrate PHP into a Java Servlet environment, which is the more stable and efficient solution, or integrate Java support into PHP. The former is provided by a SAPI module that interfaces with the Servlet server, the latter by this Java extension.
The Java extension provides a simple and effective means for creating and invoking methods on Java objects from PHP. The JVM is created using JNI, and everything runs in-process.
Example Code:
getProperty(’java.version’) . ”; echo ‘Java vendor=’ . $system->getProperty(’java.vendor’) . ”; echo ‘OS=’ . $system->getProperty(’os.name’) . ‘ ‘ . $system->getProperty(’os.version’) . ‘ on ‘ . $system->getProperty(’os.arch’) . ‘ ‘; // java.util.Date example $formatter = new Java(’java.text.SimpleDateFormat’, “EEEE, MMMM dd, yyyy ‘at’ h:mm:ss a zzzz”); echo $formatter->format(new Java(’java.util.Date’)); ?>
The behaviour of these functions is affected by settings in php.ini.
Table 1. Java configuration options
Name
Default
Changeable
java.class.path
NULL
PHP_INI_ALL
Name Default Changeable
java.home
NULL
PHP_INI_ALL
java.library.path
NULL
PHP_INI_ALL
java.library
JAVALIB
PHP_INI_ALL
29. How can I find what type of images that the php version supports?
Using Imagetypes() function we can know

30. How can we send mail using JavaScript?
No. You can’t send mail using Javascript. But you can execute a client side email client to send the email using mailto: code.
Using clientside email client

function myfunction(form)
{
tdata=document.myform.tbox1.value;
location=”mailto:mailid@domain.com?subject=”+tdata+”/MYFORM”;
return true; }

    }

Continue Reading

Interview questions For PHP

Posted on 03. Apr, 2009 by admin.

0

  • What does a special set of tags <?= and ?> do in PHP?

    Its called short tag , in this case the output is directly displayed on the browser without using the echo or print statement.

  • What’s the difference between include and require,include_once and require_once? – In case of include and require it differ in how they handle failures. If the file is not found by require(), it will definatly cause a fatal error and halt the execution of the script. If the file is not found by include(), a warning will be issued, but execution will continue.

    Where as in case of include_once and require_once the basic differnence remain the same as the above mentioned but both have a common feature in which the script or the file is included only once irrespective of how many times a file is included in the program , it definatley fast up the execution where same file is included many times.

  • I am trying to assign a variable the value of 0123, but it keeps coming up with a different number, what’s the problem? -

    PHP Interpreter treats numbers beginning with 0 as octal. Thats the main reason.

  • Would I use print “$a dollars” or “{$a} dollars” to print out the amount of dollars in this example? – In this example it wouldn’t matter, since the variable is all by itself, but if you were to print something like “{$a},000,000 mln dollars”, then you definitely need to use the braces.

  • How do you define a constant? -

    We can do this by define() directive, like define("ROOT", "localhost"); and A valid constant name starts with a letter or underscore, followed by any number of letters, numbers, or underscores.

  • How do you pass a variable by value? -

    As we do in C++, place an ampersand in front of it, like $a = &$b

  • Will comparison of string “10″ and integer 11 work in PHP? -

    Yes, internally PHP will cast everything to the integer type, so numbers 10 and 11 will be compared.

  • When are you supposed to use endif to end the conditional statement?

    When the original if was followed by : and then the code block without braces.

Continue Reading

Usefull Php Classes for reuse

Posted on 01. Apr, 2009 by admin.

24

Simplicity and extensibility are the main reasons why PHP became the favourite dynamic language of the Web. In the last decade, PHP has developed from a niche language for adding dynamic functionality to small websites to a powerful tool making strong inroads into large-scale Web systems.

Below I present 30 useful PHP classes and components that you can use to test, develop, debug and deploy your PHP applications. Let me know if I missed anything or if you have something to add.

Database

Creole

Creole is a database abstraction layer for PHP5. It abstracts PHP’s native db-specific API to create more portable code while also providing developers with a clean fully object-oriented interface based loosely on the API for Java’s JDBC. Creole was originally created as a sub-project of Propel to meet specific needs that none of the available abstraction layers were able to address in any satisfactory way.

LINQ for PHP

LINQ is a component that adds native data querying capabilities to PHP using a syntax reminiscent of SQL. It defines a set of query operators that can be used to query, project and filter data in arrays, enumerable classes, XML, relational database, and third party data sources.

ADOdb

ADOdb Database Abstraction Library for PHP. It supports MySQL, PostgreSQL, Interbase/Firebird, Informix, Sybase SQL Anywhere, Oracle, MS SQL 7 and 2000, SAP DB, Sybase, DB2, FrontBase, Foxpro, Access, Netezza, LDAP, ODBTP, ADO, and generic ODBC. It also features portable database creation, database-backed session support (with encryption), SQL performance monitoring and database health checks.

Propel

Propel is an Object-Relational Mapping (ORM) framework for PHP5. It allows you to access your database using a set of objects, providing a simple API for storing and retrieving data.

Doctrine

Doctrine is a tool for object-relational mapping in PHP. It sits on top of PDO and is itself divided into two main layers, The DBAL and the ORM. The Doctrine ORM is mainly build around the ActiveRecord, Data Mapper and Metadata Mapping patterns.

PHPillow

PHPillow is an object orientated wrapper for CouchDB.
Development

phpDocumentor

phpDocumentor is the current standard auto-documentation tool for the php language. Similar to Javadoc, and written in php, phpDocumentor can be used from the command line or a web interface to create professional documentation from php source code. phpDocumentor has support for linking between documentation, incorporating user level documents like tutorials and creation of highlighted source code with cross referencing to php general documentation.

HTML Purifier

HTML Purifier is a standards-compliant HTML filter library written in PHP. HTML Purifier will not only remove all malicious code (better known as XSS) with a thoroughly audited, secure yet permissive whitelist, it will also make sure your documents are standards compliant, something only achievable with a comprehensive knowledge of W3C’s specifications.

PHP CodeSniffer

PHP CodeSniffer is a PHP5 script that tokenises and “sniffs” PHP code to detect violations of a defined set of coding standards. It is an essential development tool that ensures that your code remains clean and consistent. It can even help prevent some common semantic errors made by developers.

GeSHi

GeSHi is a generic syntax highlighter for PHP that takes any source code and highlights it in XHTML and CSS. It features case-sensitive or insensitive highlighting, auto-caps/non-caps of any keyword, an unlimited scope for styling, the use of CSS in which almost any aspect of the source can be highlighted, the use of CSS classes to massively reduce the amount of output code, function-to-URL capabilities, line numbering, and much more.
Unit Testing

PHPUnit

To make code testing viable, good tool support is needed. This is where PHPUnit comes into play. It is a member of the xUnit family of testing frameworks and provides both a framework that makes the writing of tests easy as well as the functionality to easily run the tests and analyse their results.

SimpleTest

Unit testing, mock objects and web testing framework for PHP built around test cases. If you know JUnit/JMock or some of the PHPUnit clones this will need no explanation. Includes a native web browser for testing web sites directly.

PHPSpec

PHPSpec allows you to write executable examples reflecting specifications of the desired behaviour of the source code being described. You can write code examples which are repeatable, this means you write an example and may repeat it as often as you wish to ensure the implementation code it relates to continues to abide by the example.
Debugging

PHP Debug

During both the development and deployment phases, developers require a consistent stream of diagnostic information in order to determine whether the application is working as intended. The functionality of the PHP Debug component can be used to write debug messages and measure the execution time.

dBug

dBug is the PHP version of ColdFusion’s cfdump. It outputs coloured and structured tabular variable information and has the ability to force certain types of output.
Deployment

Phing

Phing it’s a project build system based on Apache Ant. You can do anything with it that you could do with a traditional build system like GNU make, and its use of simple XML build files and extensible PHP task classes make it an easy-to-use and highly flexible build framework.

Xinc

Xinc is a continuous integration server written in PHP 5. It has built-in support for Subversion and Phing (and therefore PHPUnit), and can be easily extended to work with alternative version control or build tools.
Security

Securimage

Securimage is an open-source free PHP CAPTCHA library for generating complex images and CAPTCHA codes to protect forms from spam and abuse. It can be easily added into existing forms on your website to provide protection from spam bots. It can run on most any web server as long as you have PHP installed, and GD support within PHP.

Scavenger

Scavenger is an open source real-time vulnerability management tool. It helps you respond to vulnerability findings, track vulnerability findings, review accepted or false-positive answered vulnerabilities, and not ‘nag’ you with old vulnerabilities.

PHP Security Scanner

PHP Security Scanner is a tool written in PHP intended to search PHP code for vulnerabilities. MySQL DB stores patterns to search for as well as the results from the search. The tool can scan any directory on the file system.

PHPIDS

PHPIDS (PHP-Intrusion Detection System) is a simple to use, well structured, fast and state-of-the-art security layer for your PHP based web application. The IDS neither strips, sanitizes nor filters any malicious input, it simply recognizes when an attacker tries to break your site and reacts in exactly the way you want it to.
User Authentication

phpGACL

phpGACL is an set of functions that allows you to apply access control to arbitrary objects (web pages, databases, etc) by other arbitrary objects (users, remote hosts, etc). It offers fine-grained access control with simple management, and is very fast.
XML and PHP

SimplePie

SimplePie is a very fast and easy-to-use class, written in PHP, that puts the “simple” back into “really simple syndication”. Flexible enough to suit beginners and veterans alike, SimplePie is focused on speed, ease of use, compatibility and standards compliance.

PHP Universal Feed Generator

This package can be used to generate feeds in either RSS 1.0, RSS 2.0 or Atom formats.
Image Handling

WideImage

WideImage is an object-oriented library for image manipulation, written in PHP 5. It’s a pure-PHP library and doesn’t require any external libraries apart from the GD2 extension.
Graphs and Charts

pChart

pChart is a PHP class oriented framework designed to create aliased charts. Most of todays chart libraries have a cost, our project is intended to be free. Data can be retrieved from SQL queries, CSV files, or manually provided. Focus has been put on rendering quality introducing an aliasing algorithm to draw eye candy graphics.

JpGraph

JpGraph can be used to create numerous types of graphs either on-line or written to a file. JpGraph makes it easy to draw both “quick and dirty” graphs with a minimum of code as well as complex graphs which requires a very fine grained control. The library assigns context sensitive default values for most of the parameters which minimizes the learning curve.

PHP Google Charts API

The Google Chart API returns a PNG-format image in response to a URL. Several types of image can be generated: line, bar, and pie charts for example. For each image type you can specify attributes such as size, colors, and labels.

PHP/SWF Charts

PHP/SWF Charts is a simple, yet powerful PHP tool to create attractive web charts and graphs from dynamic data. Use PHP scripts to generate or gather the data from databases, then pass it to this tool to generate Flash (swf) charts and graphs.

Open Flash Chart

This is an object oriented library for live-manipulating Open Flash Chart.
Template Engines

Savant

Savant is a powerful but lightweight object-oriented template system for PHP. Unlike other template systems, Savant by default does not compile your templates into PHP; instead, it uses PHP itself as its template language so you don’t need to learn a new markup system. Savant has an object-oriented system of template plugins and output filters so you can add to its behaviour quickly and easily.

Smarty

Smarty is a template engine for PHP. More specifically, it facilitates a manageable way to separate application logic and content from its presentation. One of the unique aspects about Smarty is the template compiling. This means Smarty reads the template files and creates PHP scripts from them. Once they are created, they are executed from then on. Therefore there is no costly template file parsing for each request.

PHPTAL

PHPTAL is a templating engine for PHP5 that implements brilliant Zope Page Templates syntax. PHPTAL is fast thanks to compiled templates and fine-grained caching. Makes it easy to generate well-formed XML/XHTML.
Documents

TCPDF

TCPDF is a PHP class for generating PDF documents without requiring external extensions. TCPDF supports all ISO page formats and custom page formats, custom margins and units of measure, UTF-8 Unicode, RTL languages, some HTML code, barcodes, TrueTypeUnicode, TrueType, Type1 and encoding, JPEG, GIF and PNG images, graphic functions, bookmarks, JavaScript, forms, page compression, and encryption.

PHP Excel

Create Excel documents in PHP. This component provides a set of classes for the PHP programming language, which allow you to write to Excel 2007 files and read from Excel 2007 files. This project is built around Microsoft’s OpenXML standard and PHP.

Continue Reading

Get Adobe Flash playerPlugin by wpburn.com wordpress themes