50 Free High Quality Web Templates

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

http://www.noupe.com/css/50-free-high-quality-and-new-xhtmlcss-templates.html

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:

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.

Problem and Solution!

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

I found an interesting problem on net and as a noivce decided to solve it all by self with the help of PHP.
Problem:”If we list all the natural numbers below 10 that are multiples of 3 or 5, we get 3, 5, 6 and 9. The sum of these multiples is 23.

Find the sum of all the multiples of 3 or 5 below 1000.

Solution:
“<?php
for($counter=1; $counter < 1000 ; $counter ++)
{
//echo ”

“;
//echo ”
“.$counter.”–> “;

$int_var1 = ($counter/3); //current counter will be divided by 3
$int_var2 = ($counter/5); //current counter will be divided by 5

$str_type1 = gettype($int_var1); //This will return integer if counter was divided by 3 properly
$str_type2 = gettype($int_var2); //This will return integer if counter was divided by 5 properly

if ($str_type1 == ‘integer’ || $str_type2 == ‘integer’ ) //to check which “counter” was properly divided
{
//echo “This is integer”;
$int_result = $int_result+$counter;

}
else
{
//echo ” NON INTEGER” ;
}
}
echo “Result is: $int_result “;

?>

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

JavaScript

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

All about JavaScript and related to PHP also.

Web Designs

VN:F [1.6.9_936]
Rating: 9.0/10 (3 votes cast)

Ready made designs, contributed from our members and from different volunteer resources. Information on good designs, techniques and many more…

Web 2.0

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

All about Web 2.0 – Standards, Implementation, Uses and etc.

CSS & HTML

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

All about CSS and HTML/XHTML will be posted under this category.

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.