[pmwiki-users] Link with querystring, processing it

Patrick R. Michaud pmichaud at pobox.com
Fri Oct 13 14:31:37 CDT 2006


On Fri, Oct 13, 2006 at 10:20:30PM +0300, Erik Lindberg wrote:
> Hi there!
> 
> Is there a way to have a link such as [[TestPage?data=Hello world]] 
> My aim would be to pass some text in the querystring to another wiki page,
> such as in normal webpages by calling e.g., index.php?data=Hello%20world

[[TestPage?data=Hello%20world]] works -- see
http://www.pmwiki.org/wiki/Test/QueryString .  At present
PmWiki doesn't seem to be automatically converting spaces here
into %20, but I think we can get that to work.

> Furthermore how would I read the contents of data to a variable?

Do you mean a page variable (in the markup) or in a PHP script?

In a PHP script one could use either $_GET['data'] or $_REQUEST['data']
to get the value of any variables.

To display the content of a query variable within a page
requires a special markup for it.  The Cookbook.HttpVariables
recipe has some markups to support this (among other things).

Pm




More information about the pmwiki-users mailing list