Question

I using opencart, passing a product name to the contact page, to be used in the querybox.

URL passed in: http://www.webpage.com/index.php?route=information/contact&id=product_name

Within <head> tags: <?php $productid = $_GET['id']?>

$productid can be accessed within the head, but is undefined elsewhere on the page where needed.

How can I access this variable in the body?

Was it helpful?

Solution

You shouldn't be using it like that in the first place. OpenCart has built in variables for request vars. Use $this->request->get['id'] instead

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top