I am using google visualization api to make a plot and then using event handling to get back some information when the plot is clicked on.
When I click on the item, I open a new window with the following url which is supposed to show results from a script called articles.php
http://..../articles.php?word=nature&datetime=11-4-2011-8
articles.php starts with
$word = $_GET['word'];
$datetime = $_GET['datetime'];
When I use var_dump for debugging as follows:
var_dump($word);
var_dump($datetime);
I get string(6) "nature" string(11) "11-4-2011-8", and the rest of the script works.
However, the problem I am having is that if the word is of the following format:
word = "#someword"
then I still see the following url
http://...../articles.php?word=#nature&datetime=11-7-2011-5
but the script in articles.php doesn’t work. On using
var_dump($word);
var_dump($datetime);
I see the following:
string(0) "" NULL
I don’t understand why $_GET['word'] and $_GET['datetime] no longer work to grab the word and date transmitted in the URL when the word contains “#” as the first character. Any pointers on what is going on and how I might fix this problem?
Thanks!
For the
#symbol to be used as a value of a get parameter, it must be URL encoded. The#symbol is used in URLs to represent a named anchor or ID in your document and is not parsed into the_GETarray.