Вопрос

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?

Это было полезно?

Решение

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

Лицензировано под: CC-BY-SA с атрибуция
Не связан с StackOverflow
scroll top