I am into the whole PHP thing at the moment and learning it at a really basic level..
I was on facebook recently and noticed this code in the url after I clicked some of the buttons;
This showed up at the end of the url..
obviously the 'home' part of it is the name of the button I clicked..
I just was curious to what this is used for.
Guess it could be a couple of things. A 'go-back' flag to return you to the home page when you leave the other page / website, or it could be used for visitor tracking stats - telling Facebook where you found the button you clicked on.
It is a "url parameter", basically when the page example.php?ref=home is requested, the server will call the file example.php and serve it's output.
When the script example.php is being run, it can ask the server whether or not the "ref" url parameter is set, and if so what its value is, in this case "home".
So for example, on facebook, you could for example visit photos.php?ref=comments. When photos.php is being loaded, it can see whether or not it should show only photos with comments, or else a default, e.g. all photos.
These parameters can be accessed in PHP via the $_GET array. Let's say a user has clicked a link to example.php?user=dave.
echo "hi" . $user . "!";
As Voyager97 said, this could be used for tracking, and doesn't really have to have anything to do with the link you click on.
Good question. When you create a URL link, you can place variables in the URL. If the URL variable was ?ref=home, they could have called this from the URL. A good example of this would be, if you created a link which was http://www.mydomain.com?ref=link, you could have use the $link = $_GET in a form etc.
Obviously the GET function, gets the variable from the URL. Not the safest way to pass variables, but it can be done.