PHP Advantages, PHP Benifits

VN:F [1.6.9_936]
Rating: 1.0/10 (1 vote cast)

PHP advantages

  • PHP is offering a variety of security mechanisms.
  • it is a better choice of modular programming as it has easy connectivity abilities.
  • PHP has ability to  easily be interfaced with a variety of libraries, xml’s.
  • Open source software makes it best attractive choice for every one.
  • Easy to remember the syntax,  syntax is like to C and C++.
  • Easily can create,manage  dynamic web pages with PHP.
  • PHP People Community, a good place where people can make their scripts and post relating to the requirement.

PHP Advantage over Java:

  • PHP: easy and simple language built  for web applications
  • PHP: open source and  customization becomes convenient.
  • PHP: easily integrates with variety of database, both open-source (MySQL, PostgreSQL, SQLite) and commercial (Oracle, MS SQL Server); while Java relies on JDBC drivers for database connectivity.

Guess Gender ;-)

VN:F [1.6.9_936]
Rating: 5.0/10 (1 vote cast)

Just a simple function to demonstrate the use of a few very simple but useful functions of PHP. This function simply accepts a parameter ($relation) and returns the “Gender (sex)” of the relationship.

Here’s the function:

<?php
function guessGender($relation)
{
 $gen = "";
 $relation = ucwords(strtolower($relation));
 $relations = array(
      "Male" => array("Husband", "Son", "Father", "Brother"),
      "Female" => array("Wife", "Daughter", "Mother", "Sister")
 );

 foreach($relations as $gender => $relationType){
      if(in_array($relation, $relationType)){
           $gen = $gender;
      }
 }

 return $gen;
}
?>

For the ease of your understanding, I have linked each PHP function, language construct and other statements to Official PHP manual. Simply click on the provided links (in above code) to see the detailed information on each.

Simple File Browser with Pictures Explorer

VN:F [1.6.9_936]
Rating: 10.0/10 (1 vote cast)

This simple file browser, written in PHP, is a very useful library of functions. This library provides basic functionality of file and directory browsing along with many configurable options.

However this is a basic version, and I just wrote it to use at a client’s website. I will be extending it more to provide other useful options like Delete, Move, Copy, Rename and etc.

Currently, it provides listing of directories and files. Navigation thru directories, opening files. You can also use it as an Image/Picture Explorer. There’s a file “fb.php” included which demonstrate the usage at front-end. Following files are included in this package:

  • fb.config.php: the configuration file
  • fb.lib.php: the main library file, contains all functions
  • fb.css: the sample style sheet
  • fb.php: the sample usage file
  • images folder: includes icons for file types

Download source code here File Browser Source

Embedding PHP inside HTML

VN:F [1.6.9_936]
Rating: 6.0/10 (1 vote cast)

Embed PHP code inside HTML to add some dynamic functionality to your pages.

Common Errors (Part 3)

VN:F [1.6.9_936]
Rating: 0.0/10 (0 votes cast)

Common errors you may come across when programming, and the solutions.

Common Errors (Part 2)

VN:F [1.6.9_936]
Rating: 0.0/10 (0 votes cast)

Common errors you may come across when programming, and the solutions.

Common Errors (Part 1)

VN:F [1.6.9_936]
Rating: 0.0/10 (0 votes cast)

Common errors you may come across when programming, and the solutions.

POST Variable

VN:F [1.6.9_936]
Rating: 0.0/10 (0 votes cast)

Used for passing variables between pages on the submission of forms. The twist is, it’s hidden from the user in the URL (address) bar of a browser.

GET Variable

VN:F [1.6.9_936]
Rating: 0.0/10 (0 votes cast)

Used for passing variables between pages on the submission of forms or manual entry in the URL (address) bar of your browser.

Advanced Function

VN:F [1.6.9_936]
Rating: 0.0/10 (0 votes cast)

Not the trickiest example function, however this will teach you how to output a value created from within the function.