Make PHP variable accessible throughout webpage
Вопрос
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
Не связан с StackOverflow