Php Piwik:点击URL后应该重定向到报告页面
我正在从数据库中提取数据。如果我单击url(如图中所示),它将转到特定的网站页面。但我想在单击特定url时重定向特定的报告页面Php Piwik:点击URL后应该重定向到报告页面,php,matomo,Php,Matomo,我正在从数据库中提取数据。如果我单击url(如图中所示),它将转到特定的网站页面。但我想在单击特定url时重定向特定的报告页面 <?php public function getTemperatures() { $mysql_hostname = "localhost"; $mysql_user = "root"; $mysql_password = ""; $mysql_database = "api_enterprise"; $bd = mysql_connect($
<?php
public function getTemperatures()
{
$mysql_hostname = "localhost";
$mysql_user = "root";
$mysql_password = "";
$mysql_database = "api_enterprise";
$bd = mysql_connect($mysql_hostname, $mysql_user, $mysql_password) or die("Oops some thing went wrong");
mysql_select_db($mysql_database, $bd) or die("Oops some thing went wrong");// we are now connected to database
$result = mysql_query("SELECT * FROM website"); // selecting data through mysql_query()
while($data = mysql_fetch_array($result))
{
$temperatures[] = array(
'label1' => '<a href="'.$data['link'].'" target="_blank">'.$data['link'].'</a>',
'label2' => $data['time'],
'label3' => $data['os'],
'label4' => $data['browser'],
'label5' => $data['status'],
'label6' => $data['location'],
array('label6' => $data['widget_load_time'])
);
}
return DataTable::makeFromIndexedArray($temperatures);
}
我看了piwik的演示。我想这是你需要的:
'label1' => '<a href="index.php?module=CoreHome&action=index&date=yesterday&period=day&idSite='.$data['id'].'" target="_blank">'.$data['link'].'</a>',
'label1'=>'',
您可以根据需要编辑期间和日期参数。但可能是生成此链接的更好方法。mysql已被弃用,请尝试mysqli或更好的PDO,尤其是你失去了我,请尝试提供更多信息,因为很难理解你需要什么。如果我单击url,它将转到网站页面。但我想重定向我的自定义报告页面@约书亚夜莺