Javascript 如何按用户计算单击的URL? while($rows=mysql\u fetch\u assoc($run)){ $title=$rows['title']; $desc=$rows['description']; $url=$rows['url']; //包括'index.php'; 回声“
”; }Javascript 如何按用户计算单击的URL? while($rows=mysql\u fetch\u assoc($run)){ $title=$rows['title']; $desc=$rows['description']; $url=$rows['url']; //包括'index.php'; 回声“,javascript,php,html,Javascript,Php,Html,”; } 在这一部分中,不同的$url将在屏幕上显示给用户,用户可以单击任何url来显示数据。我想计算哪个url单击了多少次以给出页面排名???使用中介文件,而不是直接链接到url 中介PHP文件将计算它被调用的次数(在那里使用计数器),然后重定向到实际URL while($rows=mysql_fetch_assoc($run)) { $title=$rows['title']; $desc=$rows['description']; $url=$row
在这一部分中,不同的
$url
将在屏幕上显示给用户,用户可以单击任何url来显示数据。我想计算哪个url单击了多少次以给出页面排名???使用中介文件,而不是直接链接到url
中介PHP文件将计算它被调用的次数(在那里使用计数器),然后重定向到实际URL
while($rows=mysql_fetch_assoc($run)) {
$title=$rows['title'];
$desc=$rows['description'];
$url=$rows['url'];
//include 'index.php';
echo "<a href='$url'><b>$title</b></a><br><a href='$url'>$url"</a><p>";
}
请在标记上执行ajax调用onclick事件
<a href="redirect.php?redirect=http://domain.com>URL</a>
while($rows=mysql_fetch_assoc($run)) {
$title=$rows['title'];
$desc=$rows['description'];
$url=urlencode($rows['url']);
//include 'index.php';
echo "<a href='redirect.php?$url'><b>$title</b></a><br><a href='$url'>$url"</a><p>";
}
if(!file_exists('counter.txt')){
file_put_contents('counter.txt', '0');
}
file_put_contents('counter.txt', ((int) file_get_contents('counter.txt')) + 1);
header('Location: ' . $_GET['redirect']);