Multimedia and canvas elements in HTML5


The <canvas> element was originally developed by Apple® for use in Mac OS X
Dashboard widgets and in Safari, but was later adopted by Mozilla® and Opera® in
their Web browsers. The element has been standardized and included in the HTML5
specification, along with a series of 2D drawing APIs that can be used to create
shapes, text, transitions, and animations inside the element.
Many believe that the <canvas> element is one of the most important aspects of
HTML5 as it facilitates the production of graphs, interactive games, paint
applications, and other graphics on the fly without requiring external plug-ins such as
Adobe Flash.

The <canvas> element itself is quite basic, defining the width, height, and unique ID
for the object. The developer must then use a series of JavaScript APIs to actually
draw objects on the canvas, typically when the Web page has finished rendering.
These APIs allow the developer to draw shapes and lines; apply color, opacity, and
gradients; create text; transform canvas objects; and perform animation. The APIs
also allow the <canvas> to be interactive and respond to user input such as mouse
events and key events, facilitating the production of games and Web applications on
the canvas. You will see an example of the <canvas> element in action in the
sample HTML5/CSS3 Web site later in this tutorial.

<audio> and <video>

In recent years, the popularity of video sharing sites such as YouTube and content
delivery platforms like Hulu has seen a huge explosion in the use of the Web for
multimedia streaming. Unfortunately, the Web was not built with such content in
mind, and as a result, the provision of video and audio has by and large been
facilitated by the Flash Video (.flv) file format and the Adobe Flash platform.
HTML5, however, includes support for two new elements, <audio> and <video>,
which allow Web developers to include multimedia content without relying on the
user to have additional browser plug-ins installed. Several browsers, including
Mozilla Firefox, Apple Safari, and Google Chrome, have begun supporting these
new elements and providing standard browser playback controls, should the user
choose to use them. In addition, a set of standard JavaScript APIs has been
provided to allow developers to create their own playback controls, should they wish
to do so. A key advantage to native multimedia playback is that it theoretically
requires less CPU resources, which can lead to energy savings.
A key issue with these new multimedia elements, however, is the file formats
supported by each browser and the patent licensing issues that go along with the
various codecs that these files can be encoded with. Mozilla and Opera want to use
the open source Theora video container and codec, which does not require patent
licensing for the inclusion of the codecs in the Web browser. On the other hand,
Apple and Google are not happy with the quality of Theora, particularly for the
delivery of high definition (HD) content on the likes of YouTube. They prefer the
H.264 codec, typically contained in MP4, MOV, or MKV files.
The issue is not just with video however, as the same problems reside with audio
codecs. The MP3 and AAC formats are restricted by patents, whereas the Vorbis
format is not. The problem with Vorbis audio is that it is not in widespread use, as
portable media players and many media software applications do not support it.
There are many decisions to be made about HTML5 <video> and <audio> in the
near future, and it will be interesting to see what codecs and formats are facilitated in
the final recommendation. In the meantime, you can try to support all browsers by
making video available in a variety of formats and by providing Flash video as a
fallback. Let’s hope that a final decision is made, and that it is not left to browser
vendors to decide which formats to support, as that would essentially render these
new elements useless.
Again, you will see the <video> element in action later in this tutorial.



PHP Arrays

  1. An array is a concept of declaring a variable in which multiple values can be stored or
    An array stores multiple values in a single variable..
  2. an array in PHP is compound type.
  3. An array is actually an ordered map.
    A map is a type that maps values.
  4. Each element in array has its own index.
  5. It takes a certain number of comma separated Key =>value pairs
    Array(key=>value, key=>value, . . .)


  1. It is a function of PHP used to get the size of an array
  2. The size of an array is number of elements present in the array

Ex: count($x)

Print_r (array_name)

It is Function used to display the entire content of array with key.


We have 3 types of arrays in PHP

  1. Numeric array
  2. Associative array
  3. array

Numeric Array

Numeric stores the each array element with a numeric index.

In PHP we have 2 techniques to create a array.

  1. Assign index automatically
    $x = array(10,20,30,40)
  2. Assign index Manually
    $x = array();

Loops in arrays

Foreach loop:-

  1. For each loop gives an easy way to iterate over arrays.
  2. foreach works only on arrays and objects.

Syntax 1 of foreach :-

foreach (array as $value)


for every iteration the value of current array element is assigned to $value and the array  pointer is moved to next element so on ..
On the next loop iteration it will be looking at next array value.

Syntax2 for foreach loop

foreach (array as $key=> value)
This loop is also does the same thing , but except that the current elements key index will be assigned to the variable $key on each loop iteration.

<? PHP
Echo “size of array is “.count($x).”<br>”;
echo”size of array is “.count($y).”<br>”;
foreach($x as $k=>$R)

Associative Array

  1. An array where each ID key is associated with a value is called assosiative array
  2. With assosiative arrays we can use the values as keys and assign values to them.
  3. when storing data about specific named values, a numerical array is not always the best way to do it.

Example :-

  1. $Ages = array(“x”=>20, “y”=>30, “z”=>40);

  2. $ages = array();
    $ages[“x”] = 20;
    $ages[“y”] = 30;
    $ages[“z”] = 40;

In the both of above examples the values in the variable remains same but we used different ways to store the data.

if you do not specify a key for given value then the maximum of integer indices is taken till there, and the new key will be that maximum value+1.

if you you specify a key value that already assigned that value will be overwritten.

Multi dimension array:

An array containing one or more arrays in a multi dimension at array, each element in the main array can also be an array and each element in the sub array and so on..

if you want to remove a value from the array you need to use the function unset();
syntax: unset($age[‘x’]);



Data Types and Built in functions

PHP supports 8 data types

  1. scalar data types( A variable in which only one value can be stored at a time
    1. Boolean
    2. integer
    3. Float / Double
    4. String
  2. Compound data type (A variable in which multiple values can be stored)
    1. Array
    2. Object
  3. Special data types
    1. resource
    2. Null

The type of variable is not set by the programmer, rather it is decided at run type byPHP depending upon the context in which the variable is used.

Var_dump (Var_name):-

it is built in function of PHP used to getting the type of variable with content of variable

$X= 10; 
echo" <br>” 
$X= 10.65; 
echo" <br>” 

$X= "PSD"; 
echo" <br>” 

$X= true; 
echo" <br>”

The output Will be :-
bool True

It is also an Built in function in PHP it is used to get the type of variable.

echo gettype($a)."--".gettype($b)."--".gettype($c)."--".gettype($d);

The output will be :


It is also an Built in function in PHP it is used to change the type of variable.

< ?php $a=10; settype($a,"integer"); echo $a ."--".gettype($a); ?>

The output will be :

I will explain about notice error in the next class

It is also an Built in function in PHP it is used to removing the content from variable.

< ?php
echo gettype($a)."
echo gettype($a);

The output will be :



variables and output statements in PHP

We have 2  functions for output in PHP those are echo() and Print ()

actually output statements used to send output to the client (browser)

differences between echo() and print() are

  1. echo() is faster than print() in execution
  2. print() is return an integer value where echo() dosent return a value

in PHP the semicolon (;) is used to separate the two statements or scripts in PHP

Comments in PHP

In PHP, we use // or # to make a one-line comment

/* and */ to make a comment block:

Variables in PHP

  1. variables are used used to store values like text, string, numbers,arrays,objects, etc..
  2. when a variable is set it can be used again and again in PHP program.
  3. all the variables in PHP starts with $.
  4. in PHP an variable dose not need to be declare before it being set.
  5. it is not necessary to tell PHP which data type is the variable.
  6. PHP automatically converts the variable into correct data type depending on the situation where it was being used.


echo $c;

output will be “abcxyz”

Variable naming rules

  1. A variable name can have alphanumeric characters and underscore “_”.  That is all alphabets and numbers from 0 to 9.
  2. A variable name should start with a letter or “_”. We cant use number at starting of variable name.
  3. No spaces are allowed in variable names.
  4. variable names are case sensitive.
  5. It is advised not use the reserved keywords  of PHP as a variable name.Example : $firstname, $ last_name, $_age
  6. Dot operator (.) is concadination operator in PHP
$firstname = “PSD”;
$lastname = “WEB”;
$_con = “2”;
echo $firstname.”—“.$_con.”—“.$lastname.”<br>”;
echo “$firstname.—.$_con.—.$lastname.<br>”;
echo ‘$firstname.—.$_con.—.$lastname.<br>’;

Note:If we a variable in double quotes (“ ”)self expansion of the variable will happen where the memory usage is more so we should not use variable in double quotes(“ ”)


“$firstname”  don’t use these type



Artistic border to an image

  1. Open a one-layer document, then click the Background on the Layers panel.
  2. Choose the Rectangular Marquee tool (M or Shift-M), then draw a selection marquee. Position the marquee where you want the border to be.
  3. On the Options bar, click Refine Edge.
  4. In the Refine Edge dialog, choose On White view (W), then adjust the Radius,Smooth,Contrast, and Shift Edge values to roughen the edges.
  5. From the Output To menu, choose New Layer with Layer Mask, then click OK.
  6. Click the Background, then press Shift-Backspace/Shift-Delete. In the Fill dialog, choose Use: White, Mode: Normal, and Opacity: 100%, then click OK.

Just check your image it was so easy.



WordPress web Server requirements

About the installation of WordPress everybody says that you need a minimal configuration but its not that much simple

here are the list of server requirements with version number


  • PHP 5.2.9 or greater
  • MySQL 5.0 or greater
  • The mod_rewrite Apache module


  • Windows Server® 2008 operating system
  • IIS 7
  • PHP 5.2.9 or greater
  • MySQL 5.0 or greater

Just ask your hosting provider dose he meet the above minimum configuration.

if you already taken your hosting then check the details by phpinfo() function.

happy blogging with WordPress



Whats New in wordpress 3.5 – Elvin

WordPress, has released new version wordpress 3.5, the 80th version of WordPress. it brings with it some changes to help maintain its dominant position as the CMS of choice for bloggers and developers all over the world.

There are some obvious changes that we will all notice immediately and then there are some that maybe not everyone will notice, it is however shaping up to be a great release. Let’s take a look at some of what’s new!

lets discuss what Removed, Modified


  1. Links
    The “Links” Manager will be disabled by default on new WordPress installs. For upgrades from a previous version to WordPress 3.5 will keep the menu in place.
    If you want to keep the links then add plugin.
  2. Remote Publishing
    Atom is gone as of 3.5 and if you are using it you will need to use a 3rd party plugin.
  3. Privacy
    The link Privacy is removed in wordpress 3.5 previously it was under
    Now it was available as a single tick box under
    Settings->Reading page.
  4. Media Uploads
    Media Uploads Folder can no longer in Settings->Media
    if you want option then edit the functions.php


  1. Now the default theme with WordPress 3.5 is responsive
  2. My admin dash board looks much better.
  3. All the buttons now have a familiar rounded square look much like Twitter Bootstrap.
  4. TinyMCE has been updated to 3.5.7 and now also supports HTML5 tags
  5. jQuery gets updated to 1.8.3. jQuery UI is now 1.9.2. now you can use protocol-relative links when enqueuing scripts and styles.
  6. In the post or page editor the “HTML” tab has been renamed “Text”.
  7. Media:One of the single biggest changes in WordPress 3.5 is the way media is handled. The media library has had a much needed overhaul, when you edit an image you now get an edit screen more like the edit post screen.
  8. Better image quality for automatically resized images.
  9. Add Media : modal box with a much clearer workflow on how to upload, edit and insert your images. You can add Featured images from within the Add Media screen now and insert a gallery directly as well. No more uploading, saving, moving tabs and hoping it might appear. It was much more like Facebook or Flickr.



Creating Downloading Icon

Step 1

create a document in Photoshopwith an dimensions of 600 x 400 px. Fill the background colour with #f0e9dd.

Step 2

Select Ellipse tool (U). Create a nice circle with the size you like.
Next, select the pen tool (P). Ctrl + click on the circle you just made. This should make the anchor points of the object show.
Again ctrl + click, but now only on the lower anchor point. You should see this now:


Step 3

With that anchor point selected, hold shift and press your down arrow twice. This should drop the point 20px down. There it is, the sort of upside down egg shape.

Let’s style that thing up!
All there is on there is:

· Gradient Overlay

· Inner shadow

· Stroke

Settings below:







Step 4

Next lets make a small shape on the bottom of of main shape as shown in the below.

I have used the pen tool (P) . next use some layer styles.

  1.  Drop Shadow
    1. Blend Mode : Normal, Color #5C5C5C
    2. Angle : 90 Degrees
    3. Distance : 1 Px
  2. Inner Shadow
    1. Blend Mode : Multiply, Color #202020
    2. Opacity : 50%
    3. Distance : 2 Px
  3. Color overlay
    1. Blend Mode : Normal, Color #202020.

Now the image looks like same below.




Step 5

Lets create an  inside of the colored circle.

  1. Drop Shadow
    1. Blend Mode : Normal Color (#FFFFFF)
    2. Opacity 40%
  2. Inner Shadow
    1. Blend Mode   :Normal Color (#000000)
    2. Opacity   : 40%
  3. Inner Glow
    1. Opacity   : 15%
    2. Color    : #000000
  4. Gradient Overlay
    1. Overlay colors from #515151 to #393939

Like this:



Step 6

We’ll be adding text to this later.

Now it’s time for the orange loading bar. I guess there are more ways to make this. But I took the easiest approach. First, create an Ellipse again. about 10px larger than the one above. Make sure the layer is set beneath the dark ellipse and above the main shape.

Now we’re gonna modify this shape a bit with the pen tool by adding some anchor points and curving some lines. Try to make it like this:

This shape has 5 added layer styles, and next to that some lighting layers above which we will get to after this.

Layer styles:

  1. Drop Shadow
    1. Blend Mode :  Normal color (#000000)
    2. Opacity 55%
  2. Inner Shadow
    1. Blend Mode Hard light  : Color (#FFFFFF)
    2. Opacity  :  35%
  3. Inner Glow
    1. Blend Mode : Overlay
    2. Opacity   : 30%
    3. Color   :FFFFBE
    4. Size :  10Px
  4. Color Overlay
    1. Color : #FF7E00
  5. Stroke (with gradient)
    1. Size  : 1Px
    2. Position  : Outside
    3. Opacity   :  55%
    4. Fill type :  gradient (colors from #353535 to #494949

It should be like this

Step 7

Now, make a new layer, (ctrl-shift+N) and ctrl click on the orange shape layer thumbnail. This should bring up a selection.

Put the new layer selected on Blending mode Soft light, grab the brush tool with about a 40px radius and white colour and start playing around to make some highlights on the orange circle.

Than, again a new layer. Still with the selection of the orange circle. Again on soft light, pull down the opacity to about 60-70% and pull a standard black-white gradient from top to bottom.

Now you should have something like this:

Step 8

Load the selection of the orange layer again (ctrl+click on the layer thumbnail). Rasterize the new shape we made and hit delete. This should delete all of the overlapping on the orange. Doe the same thing again, but now load the selection of the inner dark circle. So you only have the visible of the circle left. (The one-quarter piece). Let’s give it some styling.

  1. Drop Shadow
    1. Blend mode : Normal , Color #484848
    2. Angle 120°
  2. Inner Shadow
    1. Blend Mode Multyply, Color (#000000)
    2. Opacity  : 75%
    3. Angle : 90 °
  3. Gradient Overlay
    1. Colors From #000000 to #575757



Few things left to do.

  • Add the numbers in the middle.
  • Highlights on all the shapes.
  • Simple background shadow

Grab the text tool, with the Open Sans font, typ 75% in the middle on everything (16px, bold #ddd3c3). Give the text a drop shadow, deselect the Global lighting option and set the direction to -90 degreesdistance: 1, spread: 0, size: 0. Colour: #000.

Another text layer beneath the percentage. This will show the file size, or download speed. Whatever you like. Same styling same options, only not bold and 10px big now.

All set, now we have this:

Download the original PSD file here



Operators in PHP

Operators are used to perform some operations on data operators are broadly classified into 2 categories

  1. Unary operators
    An operator  that requires only one operant in unary operator.
    Ex: $a++
    in the above statement a is operant and ++ is operator
  2. Binary Operator
    An operator that require two operant is called as binary operator.
    Ex: $a+$b

We have 8 types of operators in PHP those are

  1. Arithmetic operators
    1. +
    2. *
    3. /
    4. %
    echo $c;      
    the output is 
  2. Assignment operators
    1. =
    2. +=
    3. -=
    4. *=
    5. /=
    6. %=
    7. .=
    echo $a."
    The output is


  3. increment and decrement Operators
    1. ++(increases value by one)
    2. –(Decrease value by one)
      echo $x++."--".++$x;      
      Output is      
  4. Relation operators
    1. <
    2. >
    3. <=
    4. >=
    5. == (will check only for content is same or not)
    6. !=
    7. <>
    8. === (will check content and type of content also)
    9. !==
  5. Logical operators  (it was used to frame a compound condition)
    1. &&
    2. ||

      In case of logical operators all the expressions will not be evaluated every time . It is based on the result of first condition.(($a>$b)&&($a>$c))


  6. Negation operators

    it used to multiply a number with “-“ operator$a=10;


  7. Error Control operators  (@)

    when prepended with an expression, any warning messages that is being generated will gets suppressed.

  8. Bitwise operators

    Bit wise operators are 3 they are

    1. AND –&
    2. OR    — |
    3. XOR  — ^

      In this case bit wise operators both operant will converted to binary form and corresponding bitwise operation will be performed.

  9. Shift Operators
    1. Left Shift operator (<<)
    2. Right shift operator (>>)

      In this case of shift operators the first operant will be converted to binary form and corresponding shifts will happen based on second number of operant.EX:–

      echo (100>>2);

      echo (100<<2);

      output will be



  10. String / Concadination operator
    1. .
    2. .=
  11. concadination / ternary operator
    1. ?:
  12. Type operator
    1. “insaneof”
  13. New Operator
    1. new
  14. Scope operator
    1. ::
  15. De-referencing operator
    1. ->



Introduction to PHP

Hi Guys

Let me teach about PHP in easy steps. First of let me explain what is Programing Language.

“ A Programing language is artificial language used to express  computer that can be performed with a machine, particularly Computer.”

  1. PHP is recursive acronym stands for  Personal Home Page, it is now said to stand for PHP: Hypertext Preprocessor
  2. PHP Is used for developing 3 types of applications
    • Command Line scripting
    • Desktop (or) GUI
    • Web Applications
  3. The main purpose of introducing PHP is to develop Web applications.
  4. PHP programs saved with an extension of .PHP
  5. Actually all the web applications runs in an request and respond mechanism (or) client server mechanism.
  6. The Programs which present in the client machine are sending requests to the server and getting response from server is called client side programs.
    examples: Firefox, Chrome, Internet explorer
  7. All the PHP programs gets executed in server and will give a response back to the client (Browser) in pure HTM format.
  8. Every PHP program contains HTML Tags plain text and PHP scripts.
  9. A web server is an application running in the server machine.
  10. PHP programs can be Placed in most of web servers.
    Example: IIS, ApacheNGINX
  11. PHP can run almost any Database.
  12. PHP is platform independent.
  13. At the time of PHP script execution in webserver the PHP script converts into “opcode” (Operational code) and send it to interpreter.
  14. The PHP interpreter is ZEND it is also called PHP parser.
  15. This Interpreter converts the “opcode” to HTML.
  16. For more details about History Click here for Wikipedia.
  17. On Next Class we will discuss about Instalation of PHP.



Creating Reset.css

Too many CSS designers don’t realize the importance of creating a “reset.css” file. When you have an environment where each browser has its own “default” styling, you’ll often find yourself thumping your skull as you ask yourself, “Why is there a spacing here?” To save yourself some of the headaches that you’ll undoubtedly experience, you’ll need to create your own simple reset file. The problem with using one of the many currently existing frameworks is that they aren’t tailored specifically to you. For example, I never use the deprecated “center” element in my projects. Consequently, I don’t need to put it into my default styling. However, others may need to do so – though they would deserve a slap on the wrist…or the buttocks if you’re so inclined.

Step 1: Zero Out Your Margins And Padding

By default, the browsers will add margins to many elements. For example, typically there are about six pixels of margins on the body element. As the designer, you should be the one specifying these figures! (Except maybe when it comes to font size – which is a whole other topic to be debated at length.) So let’s zero out a bunch of these elements!


body, html, div, blockquote, img, label, p, h1, h2, h3, h4, h5, h6, pre, ul, 

ol, li, dl, dt, dd, form, a, fieldset, input, th, td 

margin: 0; padding: 0; border: 0; outline: none; 

Step 2: Take Control Of Your Elements

You may have noticed that your elements vary in size from browser to browser. You can change this by setting the default font-size to 100%.


h1, h2, h3, h4, h5, h6 

font-size: 100%; 


Next, we’ll need to define the margins and padding for our heading elements. I’m also going to remove the list-style-type from my list elements. Lastly, I’ll set a base font-size for the body element.


line-height: 1; 

font-size: 88%; 


h1, h2, h3, h4, h5, h6 

font-size: 100%; 

padding: .6em 0; 

margin: 0 15px; 


ul, ol 

list-style: none; 



border: 0; 

Step 3: Expand

I typically like to include a few common classes that I use in all of my projects. You may or may not choose to use these yourself.



float: left; 

padding: .5em .5em .5em 0; 



float: rightright; 

padding: .5em 0 .5em .5em; 


Here Is Our Final Simple Reset.css File.


body, html, div, blockquote, img, label, p, h1, h2, h3, h4, h5, h6, pre, ul, ol, 

li, dl, dt, dd, form, a, fieldset, input, th, td 

margin: 0; padding: 0; border: 0; outline: none; 



line-height: 1; 

font-size: 88% /* Decide for yourself if you want to include this. */; 


h1, h2, h3, h4, h5, h6 

font-size: 100%; 

padding: .6em 0; 

margin: 0 15px; 


ul, ol 

list-style: none; 


color: black; 

text-decoration: none; 



text-decoration: underline; 



float: left; 

padding: .5em .5em .5em 0; 



float: rightright; 

padding: .5em 0 .5em .5em; 


At least for me, this is all I need to get started with a new website. For your own projects, you should expand upon what I have here so that it best suits you. You should probably specify the margins on more of your commonly used elements, like the paragraph tag.



Shape Buttons



Step 1

Create a Shape

Step 2

Copy the Layer Style

Step 3

Create 3 White shadows using different layers and apply overlay and soft light effect

Step 4

Create text.

Very simple! Enjoy :)

Download the source file Below.




Installing PHP in local system with XAMPP

HI guys

If we want work with PHP we need following products in our system .

  1. PHP
  2. Database server
  3. mail Server
  4. FTP client (Used to upload and download the content to the server)
  5. A tool for remote Database administration.

The following installers can be used to install all the above products in our system.



The above listed are different installers different operating systems.

in our case we are selecting XAMPP in this X means any operating system. (i am using windows operating system)

To download go the following URL

and select the installer, by the time of publishing the XAMPP version is 1.8.0

Installing XAMPP

Double click on Downloaded file

Select language  Press OK

Select NEXT

Select the installation Folder, by default it will create a folder “XAMPP” in your operating system drive as shown above

In the next screen it will shows the options as shown like above

  1. Create desktop Icon (it is recommended )
  2. Create Apache Friends XAMPP folder in Start menu (It is also recommended )
  3. Next service section (SERVICE SECTION) If you select any one of them they will start automatically at the time of windows boot it is not preferable better don’t select
  4. Press Install

Now the XAMPP is going to install. it will take little time as per your system environment.



After the Installation complete XAMPP will ask for to start the Control Panel

Press yes you will get screen like above.


Ok Guys now the XAMPP has installed successfully on your system. to check this

start the APACHE  server by clicking on the “Start” button shown in the below image 


Now go to your browser and type as below


now you will get the XAMPP default page.


If you have problem to start the apache server

Check your System has Skype, Teamviewer, Oracle, or any testing tool softwares , if you found any softwares try to uninstall those

because apache by default runs in in port 80, i want to change it to 8082

If you dont want to uninstall and the softwares then change the port number for apache.

to do this follow this simple steps

Open c:\xampp\apache\conf\ open “httpd.conf” file with text editor (notepad)

search for the word which mentioned “Listen :80”

change the “listen 80” to another number Like “listen:8082

and also change the “ServerName localhost:80″ to “ServerName localhost:8082”

now save the “httpd.conf” file and restart the apache server

go to your web browser type “localhost:8082

now you will get XAMPP page it will ask for language selection

select your language and you will get xampp page it will shows the xampp version, PHP version , … it was installed