-2

I am unsure how to word this question so editing is greatly appreciated - edit before you downvote! How can I do something like Google has done:

https://www.google.co.uk/webhp?tab=ww&ei=d7hPU4L4IMOl0wWqzICICA&ved=0CBYQ1S4#q=stackoverflow

They have a question mark ('?') and then a variable which is set by the previous page. How does this work and what do I need to do to utilize it in my page, and with javascript? Please edit this if you know how to word it better.

Quentin
  • 914,110
  • 126
  • 1,211
  • 1,335
jackmawer
  • 3
  • 4

1 Answers1

1

JavaScript:

window.location.search
// "?tab=ww&ei=d7hPU4L4IMOl0wWqzICICA&ved=0CBYQ1S4"
window.location.hash
// "#q=stackoverflow"

https://developer.mozilla.org/en-US/docs/Web/API/Window.location

PHP:

$_GET["tab"]
// ww

http://www.php.net/manual/en/reserved.variables.get.php

Hash values are not sent to the server and thus are not available in PHP.

jgillich
  • 71,459
  • 6
  • 57
  • 85