I’ve already looked at the Wordpress Codex, and looked around for other solutions online, but i still can’t seem to get it working.
Basicly what i need is to pass a GET variable in an URL, and output it on the next page.
I’ve aleady tried fetching the GET variable like below:
$foo = get_query_var( 'foo' );
And doesn’t seem to work.
Also tried the more PHP oriented way:
$foo = $_GET['foo'];
Also, without success.
Any help on the matter would be most appreciated.
get_query_var() only works with the Core
Retrieve public query variable in the
WP_Queryclass of the
Your mistake is a simple PHP one: The key is
$foo = $_GET['foo']; echo $foo;
But please do not
echo user supplied data to the page without sanitizing it.