ITP

IMCA - Web Development Using PHP

What is query string in PHP

In : IMCA Subject : Web Development Using PHP

A query string  is the part of a URL that comes after the question mark (?) . It is used to pass extra information from one page to another, usually to help customize or filter content on the server side.

if  https://example.com/welcome.php?name=John is url where ?name=John is query string

Example :

<?php
if (isset($_GET['name'])) {
    echo "Hello, " . $_GET['name'];
}
?>

When Are Query Strings Used? 

    To filter  data (like search results)
    To pass small amounts of data between pages
    For tracking links (e.g., campaign IDs in marketing URLs)
    Building dynamic pages based on user input or choices

About us

A truly open platform where you may ask questions and get answers. We also provide comprehensive and easy-to-understand answers to question papers.  discover...

Site status

Flag Counter

Privacy Policy

Sitemap