PDA

View Full Version : Pass a variable via url to pages?


Andy R
12-19-2004, 02:41 PM
I am trying to figure out how I can pass a variable via a url to populate part of a module? For example, I have a module that has a JavaScript snippet that "pulls" in affiliate related goods from Amazon.com. I have this JavaScript added into a module and I want to be able to pass it different values so it will "pull" different content from Amazon.

Example:
http://www.sitename.com/?page=amazon&product=ipod

or

http://www.sitename.com/?page=amazon&product=laptop

What I need is a way to replace part of the code with ipod or laptop.

I tried to use $product in the module template as if could be simply passed in, but that did not work. What do I need to do to pass a variable via the url?

Brian
12-19-2004, 03:41 PM
Use $_REQUEST[product] in the template.