سؤال

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