web tech questions
web tech questions
How does
a web browser interact with a web server using a Uniform Resource Locator (URL)?
Explain the phases of the HTTP protocol during a client-server interaction. How
does MIME type assist in handling different types of data in web communication?
What is XHTML, and how does it differ from HTML in terms of structure and syntax?
Why is XHTML considered stricter than HTML?
How are hyperlinks created in XHTML, and what attributes are commonly used for
links? How can images be included in a webpage, and what attributes are necessary
for proper rendering and accessibility?
What are the primary attributes and functions of the following XHTML form elements?
a) <input type="password">
b) <input type="radio">
c) <textarea>
d) <select>
How is the <label> element used to associate text with form controls in XHTML? What
is the purpose of the placeholder attribute, and how does it enhance user
experience in form design?
Explain the purpose of CSS in web design. How does it improve the separation of
content and presentation compared to using inline styles in XHTML?
What are CSS selectors, and how do they determine which elements are styled?
Explain the difference between inline, internal, and external CSS, and discuss when
each should be used.
What are the components of the CSS Box Model? How can background images be added to
an element, and what properties allow you to control their positioning and
repetition?
What are the main features of JavaScript, and how does its syntax support dynamic
behavior in web pages? Describe the differences between alert(), confirm(),
prompt(), and document.write() for user interaction and output.
Explain the concept of variables in JavaScript. What are the primary data types
supported in JavaScript, and how do you declare and initialize them?
Discuss the types of operators in JavaScript and their usage. Provide an example of
using a for loop and an if-else control structure in JavaScript.
List at least three commonly used string methods in JavaScript and explain their
purposes. How are arrays declared and manipulated in JavaScript? Provide an example
of adding and removing elements.
What is the Document Object Model (DOM), and how does its tree structure represent
an HTML document? Explain how JavaScript can access and manipulate DOM elements.
What are events in JavaScript, and how can they be handled using event listeners?
Provide an example of handling a button click event. Additionally, explain the
basic steps involved in validating form inputs with JavaScript.
What is PHP, and how does its syntax enable server-side scripting? Provide a basic
example of a PHP script that outputs a simple message to the browser.
List and explain three common string methods in PHP. How can string concatenation
be achieved in PHP, and what operator is used for this purpose?
How are arrays created in PHP? Explain the logical structure of arrays and
differentiate between indexed and associative arrays with examples.
Describe at least two methods for sequential access and sorting of arrays in PHP.
Provide an example of sorting an array in ascending order using a PHP function.
What are functions in PHP, and how are they defined and called? Explain the concept
of pattern matching in PHP, and provide an example of using a regular expression to
validate a string.
What are the key differences between the GET and POST methods in form handling with
PHP? When should each method be used? Provide a code example demonstrating the use
of one of these methods.
Explain the concept of cookies in PHP. How can cookies be created, retrieved, and
deleted using PHP functions? Provide an example of setting a cookie with an
expiration time.
What is a session in PHP, and how does it differ from cookies? Describe the process
of starting, storing, and retrieving session data in PHP.
Describe the steps involved in storing data into a MySQL database using PHP.
Provide an example of a PHP script that inserts user-submitted form data into a
database table.
How can data be retrieved from a MySQL database and displayed on a webpage using
PHP? Explain the role of XHTML forms in querying and displaying data from a
database. Provide a code example for fetching and displaying records.