Back to the 2023 paper

Module III: Basics of Web Programming

20232m

What is the role of query string in web communication?

Worked SolutionAI Assisted

The query string is the part of a URL after ? that carries data to the server as name=value pairs joined by &.

https://example.com/search?q=web+tech&page=2

Role in web communication:

  • Passes parameters from client to server in HTTP GET requests (form input, search terms, filters, pagination).
  • Lets the same resource return different content based on the parameters.
  • The server reads it (e.g. $_GET['q'] in PHP, req.query.q in Express).
  • URLs with query strings can be bookmarked and shared.

Limitation: data is visible in the URL and logs and length-limited, so never send passwords through it.

Similar questions

Official AppAndroid App

PYQDeck for Android

Solve BEU previous-year exam papers anywhere, anytime. Fast search, offline paper viewing, and step-by-step solutions designed specifically for your phone.