How To Use Query String In PHP
- Query string is a part of state management in web technologies.
- Query string is used to pass the same data between website pages through hyperlinks.
- Query string value is stored/passed in browser’s address bar or url bar. Later you can get and use these stored values in your PHP web page through
$_GET[]
super global array.
Example: index page
$site_name = "TutorialsTown"; $site_url = "tutorialstown.com"; $about = "programing tutorials"; echo " Go to page-2 ";
Example: page-2
Page-2
Website name : echo $_GET['site_name'];
Url : echo $_GET['site_url'];
About : echo $_GET['about'];