When I see a page with a URL like www.site.com/main.php?page=bio ...what is used to do this? I've been trying to understand this for the longest, can someone please help?
what PHP script is used to do this?
It's not a PHP script exactly. It's actually in your HTML code. It's referring to values passed using the "get" form method instead of the "post" form method. All that stuff after the question mark is called the query string. Before the equal sign is the name of the variable, and after the equal sign is that value assigned to it. Any subsequent variable-value pairs are separated by ampersands.
Hope this helps,
Merve
Thanks!!! Do you or anyone know of a site that has tutorial of how exactly to do this?
The query string is whatever you want it to be:
<a href="http://www.yoursite.com/main.php?page=bio">click me</a>
Then in file "main.php", you reference the value from the $GET array:
<?php
switch($_GET['page'])
{
case "bio":
include "pages/bio.html";
break;
case "links":
include "pages/links.html";
break;
default:
include "pages/default.html";
}
?>