Web Technology Practical

 (1)Frames:
HTML frames are used to divide your browser window into multiple sections where each section can load a separate HTML document.
To use frames on a page we use <frameset> tag instead of <body> tag. The <frameset> tag defines, how to divide the window into frames. The rows attribute of <frameset> tag defines horizontal frames and cols attribute defines vertical frames. Each frame is indicated by <frame> tag and it defines which HTML document shall open into the frame.

(2)HTML Redirection:-
The redirection is done with the meta refresh in the head section.
The link in the body section for fallback purposes.
HTML redirection used to redirect current page to another page or resources directly on clicking the link.


(3)Redirection Through Server Side language
PHP is a server side scripting language; the redirect script will be executed on your server and not on your visitors browser. This is a non-client/browser dependent approach.
The PHP Header() Function
Redirecting URLs in PHP centers around the PHP Header() function.
Anyway for the purpose of introducing you to redirecting URLs in PHP, try this simple experiment in your XAMPP localhost.

(4)Redirection through Client side languages
Client side redirection is possible through the window object and location attributes to locates it to the particular URL for redirection purpose.
Ex:- window.location=”url”;

(5)Visible form parameters extraction through server side language
To set up a form for server processing and data retrieval, two important form attributes that controls how the form data is processed whenever it is submitted must be specified. 
Client browsers can send information to a web server in two different ways:
GET Method
POST Method

When you submit a form through the GET method, PHP provides a super global variable, called $_GET. PHP uses this $_GET variable to create an associative array with keys to access all the sent information ( form data ). 
Example:
<form action="get-method.php" method="get">
 <input type="text" name="firstname" placeholder="First Name" /> 
<input type="text" name="lastname" placeholder="Last Name" /> 
<input type=”password” name=”password” />
<input type="submit" name="submit" /> </form>
  
(6) Hidden form parameters extraction through server side languages
To set up a form for server processing and data retrieval, two important form attributes that controls how the form data is processed whenever it is submitted must be specified. 
Client browsers can send information to a web server in two different ways:
GET Method
POST Method

When you submit a form through the GET method, PHP provides a super global variable, called $_GET. PHP uses this $_GET variable to create an associative array with keys to access all the sent information ( form data ). 
Example:
<form action="get-method.php" method="get">
 <input type="text" name="firstname" placeholder="First Name" /> 
<input type="text" name="lastname" placeholder="Last Name" /> 
<input type=”password” name=”password” />
<input type="submit" name="submit" /> </form>


(7)Cookies
A cookie is often used to identify a user. A cookie is a small file that the server embeds on the user's computer. Each time the same computer requests a page with a browser, it will send the cookie too. With PHP, you can both create and retrieve cookie values.
Create a Cookie with php
setcookie(name, value, expire, path, domain, secure, httponly);
We then retrieve the value of the cookie "user" (using the global variable $_COOKIE). We also use the isset()function to find out if the cookie is set.


(8) Session
Session variables solve problem by storing user information to be used across multiple pages (e.g. username, etc). By default, session variables last until the user closes the browser.
Start a PHP Session
A session is started with the session_start() function.
Session variables are set with the PHP global variable: $_SESSION
Also notice that all session variable values are stored in the global $_SESSION variable.



(9)URL Rewriting
A rewrite engine is a software component that performs rewriting on Uniform Resource Locators, modifying their appearance. This modification is called URL rewriting. It is a way of implementing URL mapping or routing within a web application.
The engine is typically a component of a web server or web application framework. Rewritten URLs (sometimes known as short, pretty or fancy URLs, search engine friendly - SEF URLs, or slugs) are used to provide shorter and more relevant-looking links to web pages.
Web sites with dynamic content can use URLs that generate pages from the server using query string parameters. These are often rewritten to resemble URLs for static pages on a site with a subdirectory hierarchy.

(16)File Upload
With PHP, it is easy to upload files to the server.
First, ensure that PHP is configured to allow file uploads.
In your "php.ini" file, search for the file_uploads directive, and set it to On.
Next, create an HTML form that allow users to choose the image file they want to upload.
The form also needs the following attribute: enctype="multipart/form-data". It specifies which content-type to use when submitting the form.
  

(17)Server Side Includes
Server Side Includes (SSI) is a simple interpreted server-side scripting language used almost exclusively for the Web.
The most frequent use of SSI is to include the contents of one or more files into a web page on a web server.


(18)Tables with different row colors
We can make a one table and in which we can added multiple rows and columns.
And we can also differentiate each rows from others rows with different colors and font faces and font styles and size.


Comments