Download as docx, pdf, or txt
Download as docx, pdf, or txt
You are on page 1of 6

Week 2 Tutorial

1. List the Request/Response procedure for a static webpage.


You can make a simple GET request by clicking on a link or searching on a
site (like a search engine homepage). For example, the HTTP request that is
sent when you perform a search on MDN for the term "client server
overview" will look a lot like the text shown below (it will not be identical
because parts of the message depend on your browser/setup).
Enter url address
Browser looks up ip address

Request crosses the internet and arrives fnu server


Looks in hard disk

2. List the Request/Response procedure for a dynamic webpage. 

1. You enter http://server.com into your browser’s address bar.


2. Your browser looks up the IP address for server.com.
3. Your browser issues a request to that address for the web server’s home
page.
4. The request crosses the Internet and arrives at the server.com web server.
5. The web server, having received the request, fetches the home page from
its hard disk.
6. With the home page now in memory, the web server notices that it is a file
incorporating PHP scripting and passes the page to the PHP interpreter.
7. The PHP interpreter executes the PHP code.
8. Some of the PHP contains MySQL statements, which the PHP interpreter
now passes to the MySQL database engine.
9. The MySQL database returns the results of the statements back to the PHP
interpreter.
10. The PHP interpreter returns the results of the executed PHP code, along
with the results from the MySQL database, to the web server.
11. The web server returns the page to the requesting client, which displays it.
3. What are some advantages of using PHP and MySQL? 

 Open Source, Easy and fast maintenance


 Superior performance, greater scalability, reliability
 Compatible with operating system like IIS, Apache etc
 Platforms independent and runs on Linux, Windows, or Unix
 User-Friendly and programming offers multilingual support
 Wider support for other popular databases like Informix, Oracle, Sybase,
etc.
 Data security and reliable
 On demand scalability – ability to increase or decrease

4. What are some uses of PHP? Write down a simple PHP code. 

Typically, it is used in the first form to generate web page content dynamically.


For example, if you have a blog website, you might write some PHP scripts to
retrieve your blog posts from a database and display them.
Other uses for PHP scripts include: Processing and saving user input from form
data.

Allows interaction

Allows encryption of data

<? php

Echo “Hello World”;

?>

5. What are some uses of MySQL? Write down a simple MySQL code. 

 Creating and Selecting a Database.


 Creating a Table.
 Loading Data into a Table.
 Retrieving Information from a Table. Selecting All Data. Selecting Particular
Rows. Selecting Particular Columns. Sorting Rows. Date Calculations. Working with
NULL Values. Pattern Matching. Counting Rows. Using More Than one Table.
 Data housing
 Electronic commerce app
 Website database

MySQL code
For database connection
$conn = new mysqlli($servername, $username, $password);

6. What are some uses of JavaScript? Write down a simple JavaScript Code. 

 Web Development: JavaScript is a client scripting language which is used for


creating web pages
 Web Applications
 Presentations
 Server Applications
 Web Servers
 Games
 Art
 Smartwatch Applications

JavaScript – change text on button press

<button type= “button” onclick= ‘document.getElementById (“demo”). Inner HTML =


“Helo.JavaScript!” ‘ click me! </button>

7. What is an Apache Server? It is an open source http server for modern


operating systems. It is developed and maintained by the apache http server
project. What are some uses of an Apache Server?

Hosting and developing web applications

Normally used as a server


Its job is to establish a connection between a server and the browsers of
website visitors (Firefox, Google Chrome, Safari, etc.) while delivering files
back and forth between them (client-server structure). Apache is a cross-
platform software, therefore it works on both Unix and Windows servers.

8. Give an example of how Ajax can be used. 


The AJAX call fires, and sends a request to a server-side script, using XML. The server-side
script (PHP, ASP, or whatever) takes the input from JavaScript, can access the database if it
needs to, and processes the data. ... A second JavaScript function, called a callback
function,catches the data, and updates the web page.
Ajax is a new technique creating better, faster and more interactive
web app with the help of xml, html, css, and java script. The main
purpose of using ajax is for presenting dynamic content.
9. Define HTML. 
Hypertext Markup Language, a standardized system for tagging text files to achieve font,
colour, graphic, and hyperlink effects on World Wide Web pages.
Defines the meaning and structure of web content.

10. Write down the entire skeleton of HTML. 

<html>

<head>

<title> </title>

</head>

<body>

</body>

</html>

11. List the different types of headers. 


 General-header: These header fields have general applicability for both request and
response messages.
 Client Request-header: These header fields have applicability only for request messages.
 Server Response-header: These header fields have applicability only for response
messages.
 Entity-header: These header fields define meta information about the entity-body or, if no
body is present, about the resource identified by the request.

12.Differentiate between a paragraph tag and a break tag. 


Break tag is just same as pressing the enter key.It
changes the line....whereas paragraph tag is used incase while we are writing
a paragraph. <BR> tag is an empty element that is used to breaka line and
display the proceeding text from the next line, without giving any space between two
lines. It has no attribute

13. List some attributes associated with an horizontal line tag. 


Deprecated − Specifies the alignment of the horizontal rule. Deprecated −
Removes the usual shading effect that most browsers display. Deprecated −
Specifies the height of the horizontal rule. Deprecated − Specifies the width of the
horizontal rule.
Line size
Color
Width
Style
Align
14. List down at least 5 text formatting styles used in HTML. 

 <b> - Bold text


 <strong> - Important text
 <i> - Italic text
 <em> - Emphasized text
 <mark> - Marked text
 <small> - Small text
 <del> - Deleted text
 <ins> - Inserted text
 <sub> - Subscript text
 <sup> - Superscript text

15. List down the two different types of list associated with HTML. What
are some attributes associated with those lists? 
 unordered list — used to group a set of related items in no particular order
 ordered list — used to group a set of related items in a specific order

16. Define anchor link. Explain how it may used in HTML. 


An anchor tag is an HTML tag. It is used to define the beginning and end of a
hypertext link. Search engines use the tag to determine the subject matter of the
destination URL. Users click on the anchor text to reach the link target.
Is a link that takes you to another link which is part of the doc
17. Which HTML tag can be used to manipulate graphics in a web page?
What are some attributes of this HTML tag?
Img
Attributes: width, height,

You might also like