Wednesday, 29 July 2015

HTML URL Encode Tutorial

URL Encoding is the process of converting string into valid URL format.URL stand for Uniform Resource Locator. Through URL web browsers request pages from web servers.

When you click on a link in an HTML page, an underlying  a tag points to an address on the world wide web. A Uniform Resource Locator is employed to address a document on the world wide web. html url Encode Tutorial encoding is the practice of translating unprintable characters or characters with special meaning within URLs. Various characters are:

ASCII characters:  Unprintable characters usually employed for output control. Character ranges 00-1F hex (0-31 decimal) and 7F (127 decimal).

Non-ASCII characters – These are characters beyond the ASCII character set of 128 characters. This range is part of the ISO-Latin character set and includes the whole “top half” of the ISO-Latin set 80-FF hex (128-255 decimal).

The URL should only be sent over the Internet using the ASCII character-set.Since URLs often contain characters outside the ASCII set, the URL has to be converted into a valid ASCII format.Then URL encoding automatically convert the characters into a format that can be transmitted over the Internet.

The html url encoding use the “%” to replaces the non ASCII characters followed by two hexadecimal digits. The URLs should not contain spaces. The + sign is used by the URL encoding to replaces a space.

Scheme Full Form scheme used in…
http Hyper Text Transfer Protocol Generally web pages starts with http://.
https Secure Hyper Text Trasfer Protocol It is use for Secure web pages.
ftp File Transfer Protocol It is used for downloading or uploading files to a website. It is mostly useful for domain maintenance.

PHP sessions

PHP session variable is employed to store the data about,or amendment settings for a user php session tutorial. Session variables hold data concerning one single user, and are available to all pages in one application.
  • In Session variable, session data is temporary and can be deleted when the user has left the web site,If you would like a permanent storage,then you will wish to store the data during  database.

Starting a PHP session:

php session can be started by calling a function called Session_Start( ). The function initially checks if a session is already started and if none is started then it starts one. It is counseled to place the decision to call to session_start() at the start of the page.
  • Session_Start function should appear before the <html> tags.

<?phpsession_start();?><html>
<body>
<p>This is our paragraph</p>
</body>
</html>

Storing a session variable:

We can also store the session variable,see the example below:

<?php
session_start();
// store the session
$_SESSION[‘store’]=9;
?>
<html>
<body><?php
//retrieve session data
echo “Pagestore=”. $_SESSION[‘store’];
?></body>
</html>

Destroy a session variable:

By using unset() function or the session_destroy() function you can delete session data.


<?php
session_destroy();
?>
<html><body><p> This is a paragraph </p>
</body>
</html>

Wednesday, 22 July 2015

HTML5 Introduction Tutorial

About HTML5 :-

The earlier version of HTML was comes in Late 90’s. HTML5 comes recently in the market with some new features and latest technology.The demand of HTML5 increases very fast. The web developer should update there knowledge with the latest technology to survive in the market.
HTML5 is intended to deliver nearly everything you wish to try and do online while not requiring extra plugins. It will everything from animation to apps, music to films, and may even be employed to build sophisticated applications that run in your browser.
HTML5 is a cross platform i.e. you made file on one browser  and run on the different browser.
HTML5 features are not compatible with all the browser.However, major browser almost support this and they are working on it to make HTML5 fully compatible.
As you know with every new technology the rules for that technology is also be developed. So, HTML5 introduction tutorial also has following rules:
  1. The HTML5 ought be device-independent.
  2. It reduced the requirement  for external plugins.
  3. It reduce the difficulty of error handling as compare to previous versions.
  4. The scripting must be get replaced by a lot of markup.
  5. The establishment of new features ought to be supported HTML, CSS and JavaScript.

All New Features of HTML5:-

  • The <audio> and <video> determines a sound content and video for movies.
  • The <aside> determines the content aside from the page content.
  • The <canvas> determines Used to draw graphics, on the fly, via scripting.
  • The <datagrid> determines to set row or colmn grid and split number of individual column grid.
  • The <embed> determines container for an external applications. and lot more features:
For more info go to our HTML5 tag.

PHP Cookies

A Cookie is usually accustomed established a user. A cookie could be a little file that server embeds on the  user’s PC. Each time a  similar PC request a page with a browser,it will send a cookie too. With a PHP, you’ll  each produce and receive cookie’s value.
  • Setcookie( )  function  is used to set cookie.
  • Setcookie() function must appear before the  <html> tag.

Syntax of cookie is:
setcookie(name, values, expiry, path, domain);
We take a example which makes easier to understand this:

HTTP/1.1 200 OK
Date: Fri, 25 Jan 2005 18:15:05 GMT
Set-Cookie:name=joy;expires=Sunday,25-Jan-09 10:33:45 GMT;
path=/; domain=fullyhelp.com

Retrieving a cookie:

PHP $_cookie  variable is used to retrieve a cookie value.

<?php
// Print a cookie
echo $_COOKIE[“joy”];
// The technique is used to view all  cookies
print_r($_COOKIE);
?>

Delete a Cookie:

Deleting a php cookies is very simple process, set the value of the cookie to null, and also set the expire time of the cookie in the past. Ideally, one would set the expiry time to about a year in the past, so that if the system time is off , then the cookie will still delete correctly.

<?php
// set the expiration date to one year ago
setcookie(“name”, “”, time()-365);
?>

Tuesday, 21 July 2015

HTML5 Canvas Tutorial

The canvas is employed to draw graphics using scripting.It is also used to draw graphs, make photo compositions or do simple animations. Almost all the browser support support the html canvas tutorial

You can also create canvas, Basically it is a rectangular area on a HTML page which has attribute like- id, class, width, and height.

Example:

<canvas id=”myCanvas” width=”300″ height=”150″></canvas>

To make a border through canvas use style attributes.

Example:

<!DOCTYPE html>
<html>
<body><canvas id=”myCanvas” width=”300″ height=”150″ style=”border:1px solid #000000;”>
</canvas></body>
</html>

Output: 









Attribute Used:

Attribute Value Description
title text It specifies a title to keep company with the component,several browser can show this once the pointer hovers the component.
id id It defines unique id for an element.
class classname It defines the element class name.
lang URL It Sets the language code.
style style_definition It defines Helps to include inline cascading style sheet.

PHP Files and I/o

Generally, there are 4 types of  I/O files are present in PHP that are as follows: opening , writing, reading, closing a file.

Opening a File:

The fopen() function in php is used to open files. This file require two arguments first one is the file name to be open and the next is that in which mode of the file is open.

Mode Purpose
r It Open the files for reading only and it places the file pointer at the beginning of the file.
r+ It Open the files for both reading and writing.
and it places the pointer at the beginning of the file.
w It Open the files for writing only and it places the file pointer at the beginning of the file. If files does not
exist then it attemts to create a file.
w+ It open the files for both reading and writing only and it
places the pointer at the beginning of the file.If files does not
exist then it attemts to create a file.
a It Open the files for writing only and it
places the pointer at the end of the file.
If files does not exist then it attemts to create a file.
a+ It Open the files for both reading and writing only and it
places the pointer at the end of the file.
If files does not exist then it attemts to create a file.

If  you want to open a file and  fopen() function is unable to open the specified file then it returns false.
We take a example to generate a message if the fopen() function is unable to open the selected file:

<html>
<body><?php
$file=fopen(“Hello World.txt”,”r”) or exit(“Unable to open file!”);
?></body>
</html>

When you completed the changes in the open file, it is important that you must close the php files & i/o with the fclose() function. For  fclose() function it requires a file pointer as its argument and then returns true when the closure succeeds or false if it fails.
  We take a example to generate a message if the fopen() function is unable to open the selected file:

<?php
$file = fopen(“Hello.txt”,”r”);//code to be executedfclose($file);
?>

Reading a file:

Once you open a file with fopen( ) function you can read the file with fread( ) function.The file require two arguments. These must be the file pointer and the length of the file expressed in bytes.
There are various types of function for reading a file:
  • The fgets() function is used to read a single line from a file.
  • The fgetc() function is used to read a single character from a file.

Monday, 20 July 2015

HTML5 SVG Tutorial

SVG  is stand for Scalable Vector Graphics.The SVG is employed to define vector based graphics or diagrams like- pie charts, 2-d graphs etc.SVG is different from raster-based graphics, which store the color definition for each pixel in an array of data. The most common raster-based formats used on the web today are JPEG, GIF, and PNG, and each of these formats has strengths and weaknesses.

Various advantages of SVG are as follows:

  • SVG graphics are created using mathematical formulas that require far less data to be stored in the source file.
  • SVG graphics load faster because the source file size tends to be smaller.
  • SVG images are rendered by the browser and can be drawn programmatically.
  • The graphics of SVG is in XML format.
  • The SVG images can be printed with high quality at any resolution

Syntax of SVG:-

<svg xmlns=”http://fullyhelp.com/tag/wp-content/uploads/2013/11/wheel.png” >
</svg>

Example:

<html>
<body><svg xmlns=”http://fullyhelp.com/tag/wp-content/uploads/2013/11/wheel.png” >
</svg></body>
</html>

SVG  Different from Canvas:

SVG is a language for describing 2D graphics in XML whereas Canvas draws 2D graphics.
In SVG every drawn shape is remembered as an object. If attributes of an html5 SVG tutorial object are modified the browser will automatically re-render the shape.Canvas is rendered pixel by pixel. In canvas once the graphic is drawn it is forgotten by the browser. If its position ought to be modified the complete scene must be redrawn together with any objects that might have been covered by the graphic.

Attribute Value Description
title text It specifies a title to keep company with the component,several browser can show this once the pointer hovers the component.
id id It defines unique id for an element.
class classname It defines the element class name.
lang URL It Sets the language code.
style style_definition It defines Helps to include inline cascading style sheet.